Skip to content

feat: node v9 docs - #259

Merged
Justin Hammond (Justintime50) merged 7 commits into
masterfrom
node_v9_docs
Nov 16, 2026
Merged

Justin Hammond (Justintime50) merged 7 commits into
masterfrom
node_v9_docs

Conversation

@Justintime50

@Justintime50 Justin Hammond (Justintime50) commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Cuts the node examples for the v9 TypeScript rewrite of @easypost/api, following the same approach as #194 (node v8 docs).

Reviewer Note: Look at each commit individually. Commit 1 moves docs/node/current to docs/node/v8 with no changes. Commit 2 copies v8 back to current and updates the two snippets that v9 needs changed. Commits 3 and 5 fix current snippets that were already wrong before v9. Commit 4 bumps @easypost/api to ^9.2.0. Commit 6 applies the same kinds of fixes to v5 through v8, using the method names and signatures each of those majors actually had. Commit 7 removes the v8 Stripe public key snippet.

  1. Moves docs/node/current to docs/node/v8 (no changes in that commit)
  2. Adds docs/node/current for v9. Every file is copied as-is except these nine:
    • rates/retrieve-stateless.js: const rates = await ...retrieveStatelessRates(...) becomes const { rates } = await ...retrieveStatelessRates(...). In v9, retrieveStatelessRates returns the full response instead of only the rates key (beta_rate_service.ts#L20-L29, Upgrade Guide "retrieveStatelessRates Returns the Full Response").
    • billing/retrieve-stripe-public-key.js: client.BetaReferralCustomer.retrieveEasyPostStripeApiKey() becomes client.ReferralCustomer.retrieveEasyPostStripeApiKey(). v9.0.0 made this method public on ReferralCustomer (referral_customer_service.ts#L102).
    • billing/list.js: Billing.all() becomes Billing.retrievePaymentMethods() (billing_service.ts#L60).
    • smartrate/retrieve-time-in-transit-statistics.js: Shipment.getSmartrates becomes Shipment.getSmartRates (shipment_service.ts#L158).
    • luma/buy.js: Luma.buyLuma becomes Shipment.buyLuma (shipment_service.ts#L364).
    • luma/one-call-buy.js: Luma.createAndBuyLuma becomes Shipment.createAndBuyLuma (shipment_service.ts#L342).
    • luma/promise.js: Luma.promise becomes Luma.getPromise (luma_service.ts#L18).
    • endshipper/buy.js: removes the stray false argument. Shipment.buy has taken (id, rate, insuranceAmount, endShipperId) since v7 dropped carbon offset, so false was being passed as endShipperId and 'es_...' was ignored (shipment_service.ts#L76-L81).
    • reports/list.js: Report.all('payment_log', { page_size: 5 }) becomes Report.all({ type: 'payment_log', page_size: 5 }). Report.all has taken a single params object with type since v6 (report_service.ts#L41).
  3. Bumps @easypost/api from ^8.9.0 to ^9.2.0 (package.json and package-lock.json). v9 no longer depends on superagent, so the lockfile drops those transitive packages.

Fixes to older versions

These snippets were wrong for their own major too. Each fix uses only what that major's latest release exposed (checked against v8.9.0, v7.5.5, v6.8.2 and v5.10.1):

v8/billing/retrieve-stripe-public-key.js is removed: v8 had no public way to retrieve EasyPost's Stripe key (only a private helper), so there is no correct v8 call to show.

No web-docs path changes are needed. easypost-web-docs only imports docs/node/current/..., so it picks this up on its next examples submodule bump.

Comment thread docs/node/v8/api-keys/create.js Dismissed
Comment thread docs/node/v8/api-keys/disable.js Dismissed
Comment thread docs/node/v8/api-keys/enable.js Dismissed
Comment thread docs/node/v8/api-keys/retrieve.js Dismissed
Comment thread docs/node/v8/api-keys/retrieve.js Dismissed
@Justintime50
Justin Hammond (Justintime50) marked this pull request as ready for review November 16, 2026 18:00

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. two current snippets were already wrong before this and still are on v9, worth folding in:

  • docs/node/current/endshipper/buy.js:12: v7 dropped the carbon offset arg, so false lands in endShipperId and 'es_...' is ignored. buy(id, rate, null, 'es_...')
  • docs/node/current/reports/list.js:7: Report.all takes { type, page_size } since v6, so this sends neither. Report.all({ type: 'payment_log', page_size: 5 })

@Justintime50

Copy link
Copy Markdown
Member Author

looks good. two current snippets were already wrong before this and still are on v9, worth folding in:

  • docs/node/current/endshipper/buy.js:12: v7 dropped the carbon offset arg, so false lands in endShipperId and 'es_...' is ignored. buy(id, rate, null, 'es_...')
  • docs/node/current/reports/list.js:7: Report.all takes { type, page_size } since v6, so this sends neither. Report.all({ type: 'payment_log', page_size: 5 })

Good call, those are fixed as well.

@Justintime50
Justin Hammond (Justintime50) merged commit 0851933 into master Nov 16, 2026
18 checks passed
@Justintime50
Justin Hammond (Justintime50) deleted the node_v9_docs branch November 16, 2026 20:16
Justin Hammond (Justintime50) added a commit that referenced this pull request Nov 18, 2026
Cuts the Go examples for the v6.0.0 release of `easypost-go`, following
the same approach as #259 (node v9 docs).

> Reviewer Note: Look at each commit individually. Commit 1 moves
`docs/golang/current` to `docs/golang/v5` with no changes. Commit 2
copies `v5` back to `current`, switches every import to
`github.com/EasyPost/easypost-go/v6`, and updates the six snippets that
v6 needs changed. Commit 3 bumps the module to `easypost-go/v6 v6.0.0`.

1. Moves `docs/golang/current` to `docs/golang/v5` (no changes in that
commit)
2. Adds `docs/golang/current` for v6. All 125 files switch their import
from `/v5` to `/v6`. Every file is otherwise copied as-is except these
six:
- `rates/retrieve-stateless.go`: `rates, _ :=
client.BetaGetStatelessRates(...)` becomes `response, _ :=
client.BetaGetStatelessRates(...)` with `fmt.Println(response.Rates)`.
In v6, `BetaGetStatelessRates` returns the full response
(`*GetStatelessRatesResult`) instead of only the `rates` key
([rate.go](https://github.com/EasyPost/easypost-go/blob/v6.0.0/rate.go),
[Upgrade
Guide](https://github.com/EasyPost/easypost-go/blob/v6.0.0/UPGRADE_GUIDE.md#60-stateless-rates-return-the-full-response)).
- `billing/retrieve-stripe-public-key.go`:
`RetrieveEasypostStripeApiKey` becomes `RetrieveEasypostStripeAPIKey`.
- `billing/add-stripe-bank-account.go`: `MandateData.IpAddress` becomes
`IPAddress`.
- `customer-portals/create.go`: `UserId`, `RefreshUrl` and `ReturnUrl`
become `UserID`, `RefreshURL` and `ReturnURL`.
   - `embeddables/session.go`: `UserId` becomes `UserID`.
- `tax-identifiers/create.go`: `TaxId` and `TaxIdType` become `TaxID`
and `TaxIDType`.
- The renames above are from the v6 Upgrade Guide "Renamed Identifiers"
section
([UPGRADE_GUIDE.md](https://github.com/EasyPost/easypost-go/blob/v6.0.0/UPGRADE_GUIDE.md#60-renamed-identifiers)).
3. Bumps the root `go.mod` to `go 1.20` (v6's minimum) and adds
`github.com/EasyPost/easypost-go/v6 v6.0.0`. The v2 through v5
requirements are unchanged, so the older folders still build against
their own majors.

I checked the other v6 breaking changes against `current`, and none need
a snippet change:

- `trackers/list.go` only passes `PageSize`, so removing
`ListTrackersOptions.TrackingCode` doesn't affect it.
`trackers/batch.go` already uses `TrackingCodes`.
- No snippet sets `ShipmentOptions.Machinable`.
- No snippet uses the other renamed identifiers.

`just lint-go` (golangci-lint v2.15.0) reports 0 issues on `current`,
and `go vet` passes on `docs/golang/current` and `docs/golang/v5`.
`lint-go` only lints `current`, the same as before, so no CI or justfile
changes are needed.

No web-docs path changes are needed. easypost-web-docs only imports
`docs/golang/current/...`, so it picks this up on its next examples
submodule bump.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants