@particle-academy/hubspot-js 0.2.0 → 0.3.1

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/CHANGELOG.md +61 -0
  2. package/README.md +53 -0
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,65 @@ The four packages share one version, because they are generated from one
7
7
  `provider/` definition and a version that meant something different in each
8
8
  would be a version nobody could reason about.
9
9
 
10
+ ## [0.3.1] — 2026-08-24
11
+
12
+ ### Fixed
13
+
14
+ - **`@particle-academy/hubspot-js` now accepts a RANGE of `@particle-academy/hubspot-ui`, not one exact version.**
15
+
16
+ It peer-depended on `@particle-academy/hubspot-ui` at exactly the release it shipped with. That is the
17
+ strict form of the thing the kit's own rule forbids — a first-party sibling gets
18
+ a range — and the same block applied the rule correctly to its other two
19
+ dependencies. It was this one pair that slipped.
20
+
21
+ What it cost: ship `@particle-academy/hubspot-ui` with a fixed help string and every consumer on the
22
+ previous `@particle-academy/hubspot-js` had an **unmet peer**, which npm 7+ errors on. A documentation
23
+ patch could not be delivered without a matching runtime release, and a routine
24
+ `npm update` that moved the ui package alone broke the install.
25
+
26
+ The coupling is real and is not being loosened away. The ui package emits the
27
+ config schema and the js package implements against it, so a ui that adds a
28
+ field to a js that ignores it is silently wrong. But a PATCH is non-additive by
29
+ definition and a MINOR is where a field can appear — so `>=0.3.1 <0.4.0` is the
30
+ coupling that actually exists rather than the strictest one expressible.
31
+
32
+ Nothing else changed. `particle-academy/hubspot-php` and `fancy-hubspot` are unaffected; neither has an
33
+ equivalent edge.
34
+
35
+ ## [0.3.0] — 2026-08-24
36
+
37
+ ### Added
38
+
39
+ - **The README now says how to SET THIS CONNECTOR UP**, in the package itself.
40
+
41
+ Until now it explained what the four packages are, what they cost and why the
42
+ repo is generated — and said nothing about credentials, scopes, sandboxes or
43
+ operations. Somebody who installed it could not learn from it which credentials
44
+ a connection needs, where a human GETS them, which scopes to request, or what
45
+ the connector can actually do. All of that was already in the definition; the
46
+ one document a consumer reads was the one that omitted everything actionable.
47
+
48
+ The new **Setting it up** section carries:
49
+
50
+ - every credential, with the text saying where the value comes from, whether it
51
+ is **per installation** or **per connected account**, and whether it is secret;
52
+ - the OAuth authorize and token URLs and the exact scopes, verbatim;
53
+ - the access-token lifetime, and where refresh tokens ROTATE, the two things a
54
+ host must not do — retry a failed refresh, or refresh concurrently — because a
55
+ replay revokes the entire grant and nothing in the failure says why;
56
+ - the estate in this provider's own terms, including the cases where a
57
+ successful-looking run reaches nobody, or reaches the real one;
58
+ - every action and trigger with its method, path, inputs, and whether it is safe
59
+ to replay;
60
+ - a trigger's provider-side setup, which nobody can derive from anything else.
61
+
62
+ It is **generated from `provider/manifest.json`**, so it cannot drift from what
63
+ the packages do — which is the point at a few hundred providers, where a
64
+ hand-written setup section is a few hundred documents going quietly stale.
65
+
66
+ No code changed. This release exists because a registry and an installing agent
67
+ read the PUBLISHED artifact, and the artifact carried the old README.
68
+
10
69
  ## [0.2.0] — 2026-08-24
11
70
 
12
71
  ### Changed
@@ -94,3 +153,5 @@ one.
94
153
 
95
154
  [0.1.0]: https://github.com/Fancy-Friends/hubspot/releases/tag/v0.1.0
96
155
  [0.2.0]: https://github.com/Fancy-Friends/hubspot/releases/tag/v0.2.0
156
+ [0.3.0]: https://github.com/Fancy-Friends/hubspot/releases/tag/v0.3.0
157
+ [0.3.1]: https://github.com/Fancy-Friends/hubspot/releases/tag/v0.3.1
package/README.md CHANGED
@@ -27,6 +27,59 @@ dependencies.
27
27
  subject to the kit's full approval bar, and one per provider is hundreds of
28
28
  dependencies nobody is tracking.
29
29
 
30
+ ## Setting it up
31
+
32
+ Everything below is generated from `provider/manifest.json`, so it cannot disagree with what the packages do.
33
+
34
+ ### Credentials
35
+
36
+ A HubSpot connection holds 4 values.
37
+
38
+ **Two kinds of value, and mixing them up matters.** A `provider` credential is ONE value for the whole installation — an OAuth app's client secret serves every connected account. An `account` credential is one per connected account. A host that stores the second where it stores the first lets one account's credentials reach another's.
39
+
40
+ | Field | Scope | Secret | Where it comes from |
41
+ |---|---|---|---|
42
+ | **App client ID** | per installation | not secret | From your HubSpot app's Auth tab. ONE value for the whole installation -- the same app serves every connected account. |
43
+ | **App client secret** | per installation | **secret** | From the same Auth tab. Used to exchange the code and to refresh; never sent with an API request. |
44
+ | **Access token** | per connected account | **secret** | Obtained by the host's OAuth exchange, PER CONNECTED ACCOUNT. Expires after 30 minutes -- a host that does not refresh will work all afternoon and be broken by morning. |
45
+ | **Refresh token** *(optional)* | per connected account | **secret** | Also per account. Does not expire, so it is the credential worth protecting most: it mints access tokens indefinitely until the install is revoked. |
46
+
47
+ ### Authorising
48
+
49
+ HubSpot uses OAuth2 (authorization_code). The package DECLARES the exchange; the HOST performs it — a consent screen needs a browser, a redirect URI and somewhere to persist the result, and all three belong to the host.
50
+
51
+ - **Authorize URL** — https://app.hubspot.com/oauth/authorize
52
+ - **Token URL** — https://api.hubapi.com/oauth/v1/token
53
+ - **Scopes** — `crm.objects.contacts.write`
54
+ - **Access token lifetime** — 1800 seconds (30 minutes). A host that never refreshes works all afternoon and is broken by morning.
55
+
56
+ The refresh tokens do **not** rotate: the same one is reusable, so a refresh may safely be retried and may run concurrently. Stated rather than assumed, because the opposite — a provider that spends the token and revokes the grant on a replay — looks identical until it happens.
57
+
58
+ ### The estate
59
+
60
+ HubSpot has a test estate on the same host, reached with credentials from a SEPARATE test account you register. Selecting sandbox mode uses those credentials.
61
+
62
+ > HubSpot's test estate is a DEVELOPER TEST ACCOUNT: a separate portal you create from the developer account, with its own portal id, its own data and its own OAuth install. Same API host, different account -- so the credential is different and the URL is not. Test accounts expire if unused and carry reduced limits, which is why they are a place to test rather than a place to build against.
63
+
64
+ ## What it can do
65
+
66
+ ### Actions
67
+
68
+ #### `contact_create` — Create contact
69
+
70
+ Create a contact in HubSpot.
71
+
72
+ `POST /crm/v3/objects/contacts` · **unsafe to replay** — a retried durable run does it TWICE
73
+
74
+ | Input | Required | What it is |
75
+ |---|---|---|
76
+ | `email` | yes | HubSpot de-duplicates contacts on email within an account. A contact created without one cannot be de-duplicated, and a retry will make a second. |
77
+ | `firstName` | no | First name |
78
+ | `lastName` | no | Last name |
79
+ | `company` | no | Company |
80
+ | `phone` | no | Phone |
81
+ | `lifecycleStage` | no | HubSpot's own stage names. A value it does not recognise is refused at write time, not at setup. |
82
+
30
83
  ## Run it before you have credentials
31
84
 
32
85
  Every operation ships a **faker**, whether or not HubSpot has a sandbox. Set a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-academy/hubspot-js",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "HubSpot for Node — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP on @particle-academy/fancy-connector-core; no vendor SDK.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@particle-academy/fancy-flow": ">=0.47.1 <2.0",
55
- "@particle-academy/hubspot-ui": "0.2.0"
55
+ "@particle-academy/hubspot-ui": ">=0.3.0 <0.4.0"
56
56
  },
57
57
  "peerDependenciesMeta": {
58
58
  "@particle-academy/fancy-flow": {