@revfleet/hscli 0.8.12 → 0.9.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.
- package/CHANGELOG.md +166 -1
- package/README.md +220 -10
- package/dist/cli.js +27 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/agent/contracts.d.ts +3 -0
- package/dist/commands/agent/contracts.js +139 -0
- package/dist/commands/agent/contracts.js.map +1 -0
- package/dist/commands/agent/index.d.ts +3 -0
- package/dist/commands/agent/index.js +188 -0
- package/dist/commands/agent/index.js.map +1 -0
- package/dist/commands/agent/recipes.d.ts +13 -0
- package/dist/commands/agent/recipes.js +108 -0
- package/dist/commands/agent/recipes.js.map +1 -0
- package/dist/commands/agent/runner.d.ts +16 -0
- package/dist/commands/agent/runner.js +165 -0
- package/dist/commands/agent/runner.js.map +1 -0
- package/dist/commands/auth/index.js +64 -7
- package/dist/commands/auth/index.js.map +1 -1
- package/dist/commands/automation/index.js +30 -0
- package/dist/commands/automation/index.js.map +1 -1
- package/dist/commands/backup/index.d.ts +12 -0
- package/dist/commands/backup/index.js +459 -0
- package/dist/commands/backup/index.js.map +1 -0
- package/dist/commands/cms/content-ops.js +1 -1
- package/dist/commands/cms/content-ops.js.map +1 -1
- package/dist/commands/communication-preferences/index.js +207 -7
- package/dist/commands/communication-preferences/index.js.map +1 -1
- package/dist/commands/content-permissions/index.d.ts +22 -0
- package/dist/commands/content-permissions/index.js +141 -0
- package/dist/commands/content-permissions/index.js.map +1 -0
- package/dist/commands/context/index.d.ts +3 -0
- package/dist/commands/context/index.js +182 -0
- package/dist/commands/context/index.js.map +1 -0
- package/dist/commands/crm/associations.js +38 -0
- package/dist/commands/crm/associations.js.map +1 -1
- package/dist/commands/crm/custom-objects.js +39 -2
- package/dist/commands/crm/custom-objects.js.map +1 -1
- package/dist/commands/crm/dated.js +3 -3
- package/dist/commands/crm/dated.js.map +1 -1
- package/dist/commands/crm/migration.js +210 -2
- package/dist/commands/crm/migration.js.map +1 -1
- package/dist/commands/crm/properties.js +2 -1
- package/dist/commands/crm/properties.js.map +1 -1
- package/dist/commands/crm/property-batch.d.ts +1 -0
- package/dist/commands/crm/property-batch.js +44 -5
- package/dist/commands/crm/property-batch.js.map +1 -1
- package/dist/commands/crm/shared.js +21 -2
- package/dist/commands/crm/shared.js.map +1 -1
- package/dist/commands/crm/sync.js +1 -1
- package/dist/commands/crm/sync.js.map +1 -1
- package/dist/commands/doctor/index.js +193 -0
- package/dist/commands/doctor/index.js.map +1 -1
- package/dist/commands/email-tracking/index.d.ts +16 -0
- package/dist/commands/email-tracking/index.js +314 -0
- package/dist/commands/email-tracking/index.js.map +1 -0
- package/dist/commands/extensions/index.js +1 -1
- package/dist/commands/extensions/index.js.map +1 -1
- package/dist/commands/forms/index.js +15 -2
- package/dist/commands/forms/index.js.map +1 -1
- package/dist/commands/forms/legacy-v2.d.ts +7 -2
- package/dist/commands/forms/legacy-v2.js +103 -7
- package/dist/commands/forms/legacy-v2.js.map +1 -1
- package/dist/commands/guide/index.d.ts +1 -1
- package/dist/commands/guide/index.js +37 -4
- package/dist/commands/guide/index.js.map +1 -1
- package/dist/commands/internal/catalog.d.ts +1 -0
- package/dist/commands/internal/catalog.js +2 -0
- package/dist/commands/internal/catalog.js.map +1 -0
- package/dist/commands/internal/index.d.ts +26 -0
- package/dist/commands/internal/index.js +823 -0
- package/dist/commands/internal/index.js.map +1 -0
- package/dist/commands/internal-session.d.ts +15 -0
- package/dist/commands/internal-session.js +152 -0
- package/dist/commands/internal-session.js.map +1 -0
- package/dist/commands/lists/index.js +1 -1
- package/dist/commands/lists/index.js.map +1 -1
- package/dist/commands/marketing/email-audit.d.ts +32 -0
- package/dist/commands/marketing/email-audit.js +121 -0
- package/dist/commands/marketing/email-audit.js.map +1 -0
- package/dist/commands/marketing/index.js +2 -0
- package/dist/commands/marketing/index.js.map +1 -1
- package/dist/commands/mcp.js +5 -3
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/playbooks/index.d.ts +3 -0
- package/dist/commands/playbooks/index.js +228 -0
- package/dist/commands/playbooks/index.js.map +1 -0
- package/dist/commands/portals/index.d.ts +3 -0
- package/dist/commands/portals/index.js +132 -0
- package/dist/commands/portals/index.js.map +1 -0
- package/dist/commands/reports/index.d.ts +3 -0
- package/dist/commands/reports/index.js +479 -0
- package/dist/commands/reports/index.js.map +1 -0
- package/dist/commands/sales-content/index.d.ts +13 -0
- package/dist/commands/sales-content/index.js +59 -0
- package/dist/commands/sales-content/index.js.map +1 -0
- package/dist/commands/sales-templates/index.d.ts +3 -0
- package/dist/commands/sales-templates/index.js +88 -0
- package/dist/commands/sales-templates/index.js.map +1 -0
- package/dist/commands/seed/cms.js +28 -45
- package/dist/commands/seed/cms.js.map +1 -1
- package/dist/commands/sequences/index.d.ts +18 -0
- package/dist/commands/sequences/index.js +263 -0
- package/dist/commands/sequences/index.js.map +1 -0
- package/dist/commands/settings/index.js +450 -102
- package/dist/commands/settings/index.js.map +1 -1
- package/dist/commands/settings/site-settings.d.ts +3 -0
- package/dist/commands/settings/site-settings.js +106 -0
- package/dist/commands/settings/site-settings.js.map +1 -0
- package/dist/commands/ui/index.js +14 -4
- package/dist/commands/ui/index.js.map +1 -1
- package/dist/commands/workflows/index.js +2 -0
- package/dist/commands/workflows/index.js.map +1 -1
- package/dist/commands/workflows/preflight.d.ts +23 -0
- package/dist/commands/workflows/preflight.js +295 -0
- package/dist/commands/workflows/preflight.js.map +1 -0
- package/dist/core/action-contract.d.ts +43 -0
- package/dist/core/action-contract.js +207 -0
- package/dist/core/action-contract.js.map +1 -0
- package/dist/core/auth.d.ts +6 -0
- package/dist/core/auth.js +85 -0
- package/dist/core/auth.js.map +1 -1
- package/dist/core/http.d.ts +8 -0
- package/dist/core/http.js +37 -5
- package/dist/core/http.js.map +1 -1
- package/dist/core/id-maps.d.ts +27 -0
- package/dist/core/id-maps.js +204 -0
- package/dist/core/id-maps.js.map +1 -0
- package/dist/core/output.d.ts +2 -1
- package/dist/core/output.js +34 -0
- package/dist/core/output.js.map +1 -1
- package/dist/mcp/profiles.d.ts +14 -0
- package/dist/mcp/profiles.js +68 -0
- package/dist/mcp/profiles.js.map +1 -0
- package/dist/mcp/server.d.ts +5 -3
- package/dist/mcp/server.js +22 -5
- package/dist/mcp/server.js.map +1 -1
- package/docs/CAPABILITY_LIBRARY.md +29 -8
- package/docs/COMMAND_TREE.md +96 -17
- package/docs/COMPARISON.md +8 -5
- package/docs/COOKBOOK.md +124 -5
- package/docs/INTERNAL-ENDPOINTS-DISCOVERY.md +813 -0
- package/docs/INTERNAL-ENDPOINTS.md +371 -0
- package/docs/INTERNAL_ENDPOINTS.md +243 -0
- package/docs/MARKETING_SETUP.md +21 -1
- package/docs/MCP.md +28 -89
- package/docs/MCP_TOOL_CATALOG.md +192 -0
- package/docs/MIGRATION_ADAPTERS.md +115 -0
- package/docs/PORTAL_BACKUP.md +212 -0
- package/docs/PUBLISHING.md +1 -1
- package/docs/SALES_CONTENT_INTERNAL_PUNCH_LIST.md +504 -0
- package/docs/TUTORIALS/secure-agent-writes.md +49 -0
- package/docs/WHY_HOW_WHAT.md +10 -4
- package/package.json +4 -2
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# Portal Backup
|
|
2
|
+
|
|
3
|
+
Use `hscli /backup` to start from intent, then `hscli backup plan` when a
|
|
4
|
+
HubSpot portal needs to be preserved before a downgrade, migration,
|
|
5
|
+
consolidation, or forensic audit.
|
|
6
|
+
|
|
7
|
+
The command is plan-only. It does not call HubSpot and it does not write local
|
|
8
|
+
files. It renders a public-API-first runbook plus an explicit internal API
|
|
9
|
+
capture brief for browser-session tools such as a Claude extension.
|
|
10
|
+
When `--include-internal` is set, it also renders an `internalCapturePlan`
|
|
11
|
+
section with executable `hscli internal capture` commands derived from the
|
|
12
|
+
versioned internal allowlist.
|
|
13
|
+
|
|
14
|
+
See [`INTERNAL_ENDPOINTS.md`](./INTERNAL_ENDPOINTS.md) for the condensed
|
|
15
|
+
allowlisted browser-session endpoint map. The full catalogue and discovery log
|
|
16
|
+
live in [`INTERNAL-ENDPOINTS.md`](./INTERNAL-ENDPOINTS.md) and
|
|
17
|
+
[`INTERNAL-ENDPOINTS-DISCOVERY.md`](./INTERNAL-ENDPOINTS-DISCOVERY.md).
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
hscli --profile source-readonly backup plan \
|
|
21
|
+
--portal-id "$PORTAL_ID" \
|
|
22
|
+
--out-dir "$HOME/client-migration-assets/portal-$PORTAL_ID-full-backup" \
|
|
23
|
+
--include-internal \
|
|
24
|
+
--snapshot-id "portal-$PORTAL_ID-full-backup" \
|
|
25
|
+
--json
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Safety Model
|
|
29
|
+
|
|
30
|
+
- Source profiles must be set to read-only before capture.
|
|
31
|
+
- The plan never includes `--force` in executable commands.
|
|
32
|
+
- Public API capture comes first.
|
|
33
|
+
- Browser-session capture is explicit and allowlisted.
|
|
34
|
+
- `backup plan` is the orchestrator; `internal capture` is the adapter that
|
|
35
|
+
executes only the allowlisted read/read-like internal endpoints.
|
|
36
|
+
- `hscli internal capture` turns allowlisted catalogue surfaces into concrete
|
|
37
|
+
read-only JSON captures. It is not a generic internal API passthrough.
|
|
38
|
+
- The internal capture allowlist is versioned in
|
|
39
|
+
`src/commands/internal/catalog.ts`; add endpoints there with tests before
|
|
40
|
+
relying on them in a client backup.
|
|
41
|
+
- Internal capture should stay GET-only, except documented read-only search or
|
|
42
|
+
preview POST calls where the request body is saved.
|
|
43
|
+
- Backup assets must stay outside the hscli git repository.
|
|
44
|
+
- `migration/` is ignored because local capture data is client data.
|
|
45
|
+
|
|
46
|
+
## HubSpot 360 Coverage
|
|
47
|
+
|
|
48
|
+
The JSON output includes a `coverageModel` with explicit domain coverage:
|
|
49
|
+
|
|
50
|
+
- account identity, private apps, API usage, and audit logs
|
|
51
|
+
- CRM records, custom objects, properties, pipelines, association labels, and
|
|
52
|
+
engagements
|
|
53
|
+
- marketing assets, campaigns, forms, lists, subscription types, email
|
|
54
|
+
fallbacks, and consent surfaces
|
|
55
|
+
- sales, service, CMS, commerce, files, operations, automation, reporting,
|
|
56
|
+
settings, integrations, and governance
|
|
57
|
+
- UI-only surfaces such as business units, permission sets, custom views,
|
|
58
|
+
datasets, dashboard layouts, report filters, and full workflow action graphs
|
|
59
|
+
|
|
60
|
+
The plan should not pretend that public APIs cover everything. Public API
|
|
61
|
+
capture comes first; browser-session/internal capture then documents the
|
|
62
|
+
remaining HubSpot UI-only surfaces and blockers.
|
|
63
|
+
|
|
64
|
+
## What the Plan Captures
|
|
65
|
+
|
|
66
|
+
Public API capture:
|
|
67
|
+
|
|
68
|
+
- account info, private apps, API usage
|
|
69
|
+
- users, teams, owners, currencies
|
|
70
|
+
- CRM schemas, property groups, properties, pipelines, stages
|
|
71
|
+
- association labels
|
|
72
|
+
- lists, forms, workflows, marketing emails, campaigns
|
|
73
|
+
- sales sequences, meetings, calling, goals
|
|
74
|
+
- service conversations, feedback submissions, chatflows, ticket pipelines
|
|
75
|
+
- CMS pages, blogs, HubDB tables, redirects, domains, audit logs, SEO audit
|
|
76
|
+
- files and file folders
|
|
77
|
+
- communication preferences
|
|
78
|
+
- public reporting/dashboard inventory
|
|
79
|
+
- records smoke-test commands for standard CRM objects
|
|
80
|
+
|
|
81
|
+
Internal/browser-session capture brief:
|
|
82
|
+
|
|
83
|
+
- business units
|
|
84
|
+
- full app-users payloads
|
|
85
|
+
- permission sets
|
|
86
|
+
- permission-set assignments, atomic role catalog, role categories, scope
|
|
87
|
+
buckets, permission templates, seat catalog, and seat assignments
|
|
88
|
+
- datasets, SQL reporting metadata, reportable sources, and join metadata
|
|
89
|
+
- reports, report history/audit, dashboard definitions, dashboard permissions,
|
|
90
|
+
widgets, report favorites, report templates, reporting-frontend report lists,
|
|
91
|
+
and report-list views when public APIs omit details
|
|
92
|
+
- custom views, pinned views, CRM index views, visualization settings, and UI
|
|
93
|
+
search snapshots
|
|
94
|
+
- full workflow hybrid definitions, action graph details, validation output,
|
|
95
|
+
action catalog, CRM object snapshots, canvas errors, access checks,
|
|
96
|
+
filter-description previews, card positions, and bulk-processing metadata
|
|
97
|
+
- property v4 metadata, v1/v2 legacy fallbacks, property groups, grouped
|
|
98
|
+
property listings, recycled properties, quota/count metadata, fill-rate
|
|
99
|
+
snapshots, validation constraints, conditional options, and conditional rule
|
|
100
|
+
RPC reads
|
|
101
|
+
- CRM search, CRM GraphQL, object preview, and single-object UI payload helpers
|
|
102
|
+
used by report builders, quotes, help desk, and object index pages
|
|
103
|
+
- list/segment definitions from overlapping list v3, list v2, contacts-list,
|
|
104
|
+
contact-list-management, ILS segment, segments UI, and legacy segment-search
|
|
105
|
+
surfaces
|
|
106
|
+
- per-object audit logs for lists, dashboards, reports, and workflows
|
|
107
|
+
- field-level permissions and report permissions
|
|
108
|
+
- field-level permission bypass users
|
|
109
|
+
- marketing email body/settings fallbacks
|
|
110
|
+
- all communication subscription channels, including non-email definitions
|
|
111
|
+
- brand kits, brand colors, logos, favicons, fonts, and brand voice metadata
|
|
112
|
+
- internal marketing-email definitions from `cosemail`, including
|
|
113
|
+
drag-and-drop layout/theme/flex area metadata
|
|
114
|
+
- CTA placements from the new CTA builder
|
|
115
|
+
- Design Manager templates, content v2 templates/pages, themes, modules,
|
|
116
|
+
layouts, global groups, built-in module mapping, site settings, and
|
|
117
|
+
content-copy job status
|
|
118
|
+
- social broadcasts, connected social channels, and read-only ads account/UI
|
|
119
|
+
metadata RPCs
|
|
120
|
+
- sales snippets with body/htmlBody and shortcut metadata
|
|
121
|
+
- sequence usage/health, sales template bodies/usage, playbook count/version,
|
|
122
|
+
and playbook question metadata
|
|
123
|
+
- payment-account eligibility and connected-account status
|
|
124
|
+
- schema/object metadata, portal-scoped object types, event object types, and
|
|
125
|
+
framework-builder UI metadata
|
|
126
|
+
- allowlisted read-only Chirp RPC fallbacks for metadata services only
|
|
127
|
+
|
|
128
|
+
## Downgrade Checklist
|
|
129
|
+
|
|
130
|
+
1. Render the plan.
|
|
131
|
+
2. Create the output directory outside the repo.
|
|
132
|
+
3. Set the source profile to read-only.
|
|
133
|
+
4. Start a trace/no-write log.
|
|
134
|
+
5. Run public metadata capture.
|
|
135
|
+
6. Run public record capture until each object has no next cursor.
|
|
136
|
+
7. Run `hscli internal surfaces` and `hscli internal capture --all` with an
|
|
137
|
+
authenticated HubSpot browser session.
|
|
138
|
+
8. Produce `capture-manifest.json`.
|
|
139
|
+
9. Verify the no-write log contains only GET and approved read-only POST calls.
|
|
140
|
+
10. Scan the archive for secrets before sharing it.
|
|
141
|
+
|
|
142
|
+
## Claude / Browser-Session Handoff
|
|
143
|
+
|
|
144
|
+
The `claudeExtensionBrief` field in the JSON output is designed to be pasted
|
|
145
|
+
directly into a browser-session agent. It includes the portal ID, output
|
|
146
|
+
directory, no-write rule, required endpoints, optional endpoints, and logging
|
|
147
|
+
requirements.
|
|
148
|
+
|
|
149
|
+
Prefer the native hscli capture adapter first:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
hscli --profile source-readonly --json internal surfaces
|
|
153
|
+
hscli --profile source-readonly --json internal capture \
|
|
154
|
+
--all \
|
|
155
|
+
--portal-id "$PORTAL_ID" \
|
|
156
|
+
--cookie-file "$HUBSPOT_COOKIE_FILE" \
|
|
157
|
+
--out-dir "$OUT_DIR/internal-api/allowlisted-capture"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
For large or sensitive portals, prefer the surface-by-surface commands emitted
|
|
161
|
+
by `backup plan`:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
hscli --profile source-readonly --json backup plan \
|
|
165
|
+
--portal-id "$PORTAL_ID" \
|
|
166
|
+
--include-internal \
|
|
167
|
+
--out-dir "$OUT_DIR" \
|
|
168
|
+
> "$OUT_DIR/backup-plan.json"
|
|
169
|
+
|
|
170
|
+
# Then copy reviewed commands from:
|
|
171
|
+
# internalCapturePlan.surfaceCommands
|
|
172
|
+
# internalCapturePlan.parameterizedExamples
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
When a surface contains a read-only POST that needs a specific request body,
|
|
176
|
+
capture it explicitly instead of guessing:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
hscli --profile source-readonly --json internal capture \
|
|
180
|
+
--surface permission-access \
|
|
181
|
+
--endpoint app-users-batch \
|
|
182
|
+
--portal-id "$PORTAL_ID" \
|
|
183
|
+
--cookie-file "$HUBSPOT_COOKIE_FILE" \
|
|
184
|
+
--body-file app-users-batch="$OUT_DIR/internal-api/bodies/app-users-batch.json" \
|
|
185
|
+
--out-dir "$OUT_DIR/internal-api/permission-access"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
The body file is parsed as JSON, redacted into
|
|
189
|
+
`<endpoint>.request.json`, and hashed in `capture-manifest.json`. This keeps
|
|
190
|
+
Claude/browser-session captures reproducible without turning hscli into a
|
|
191
|
+
generic internal API client.
|
|
192
|
+
|
|
193
|
+
Use a browser-session agent for endpoints that need user interaction, per-asset
|
|
194
|
+
request bodies, or feature-gated pages that the generic allowlisted capture
|
|
195
|
+
cannot parameterize safely.
|
|
196
|
+
|
|
197
|
+
If an endpoint returns `401`, `403`, or `404`, document the blocker and continue.
|
|
198
|
+
Do not modify source permissions or retry write-like endpoints during backup.
|
|
199
|
+
|
|
200
|
+
For HubSpot internal browser-session endpoints, prefer the `hubspotapi-csrf`
|
|
201
|
+
cookie value as the `X-HubSpot-CSRF-hubspotapi` header. `csrf.app` is accepted
|
|
202
|
+
for older internal surfaces, but many modern endpoints require
|
|
203
|
+
`hubspotapi-csrf`.
|
|
204
|
+
|
|
205
|
+
The internal endpoint catalog is intentionally generic. Do not paste client
|
|
206
|
+
portal IDs, session IDs, browser cookies, CSRF tokens, or raw migration files
|
|
207
|
+
into hscli docs or commits. Keep that material in the local backup archive only.
|
|
208
|
+
|
|
209
|
+
Read-only POST endpoints are allowed only for search, preview, batch hydration,
|
|
210
|
+
or metadata RPC calls where HubSpot uses POST for reads. Log the request body
|
|
211
|
+
hash and save the exact body next to the response so the no-write proof remains
|
|
212
|
+
auditable.
|
package/docs/PUBLISHING.md
CHANGED
|
@@ -14,7 +14,7 @@ How to cut a new release of `@revfleet/hscli` on npm. Written for the maintainer
|
|
|
14
14
|
### 1. Land all changes on a feature branch
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
cd /
|
|
17
|
+
cd /path/to/hscli
|
|
18
18
|
git checkout -b <branch-name>
|
|
19
19
|
# ... commits ...
|
|
20
20
|
git push -u origin <branch-name>
|