Repository navigation
feat: node v9 docs - #259
Merged
Merged
Conversation
Justin Hammond (Justintime50)
marked this pull request as ready for review
November 16, 2026 18:00
Justin Hammond (Justintime50)
requested a review
from a team
as a code owner
November 16, 2026 18:00
Stephen Watkins (stephenjwatkins)
approved these changes
Nov 16, 2026
Stephen Watkins (stephenjwatkins)
left a comment
Member
There was a problem hiding this comment.
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, sofalselands inendShipperIdand'es_...'is ignored.buy(id, rate, null, 'es_...')docs/node/current/reports/list.js:7:Report.alltakes{ type, page_size }since v6, so this sends neither.Report.all({ type: 'payment_log', page_size: 5 })
Member
Author
Good call, those are fixed as well. |
Merged
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cuts the node examples for the v9 TypeScript rewrite of
@easypost/api, following the same approach as #194 (node v8 docs).docs/node/currenttodocs/node/v8(no changes in that commit)docs/node/currentfor v9. Every file is copied as-is except these nine:rates/retrieve-stateless.js:const rates = await ...retrieveStatelessRates(...)becomesconst { rates } = await ...retrieveStatelessRates(...). In v9,retrieveStatelessRatesreturns the full response instead of only therateskey (beta_rate_service.ts#L20-L29, Upgrade Guide "retrieveStatelessRates Returns the Full Response").billing/retrieve-stripe-public-key.js:client.BetaReferralCustomer.retrieveEasyPostStripeApiKey()becomesclient.ReferralCustomer.retrieveEasyPostStripeApiKey(). v9.0.0 made this method public onReferralCustomer(referral_customer_service.ts#L102).billing/list.js:Billing.all()becomesBilling.retrievePaymentMethods()(billing_service.ts#L60).smartrate/retrieve-time-in-transit-statistics.js:Shipment.getSmartratesbecomesShipment.getSmartRates(shipment_service.ts#L158).luma/buy.js:Luma.buyLumabecomesShipment.buyLuma(shipment_service.ts#L364).luma/one-call-buy.js:Luma.createAndBuyLumabecomesShipment.createAndBuyLuma(shipment_service.ts#L342).luma/promise.js:Luma.promisebecomesLuma.getPromise(luma_service.ts#L18).endshipper/buy.js: removes the strayfalseargument.Shipment.buyhas taken(id, rate, insuranceAmount, endShipperId)since v7 dropped carbon offset, sofalsewas being passed asendShipperIdand'es_...'was ignored (shipment_service.ts#L76-L81).reports/list.js:Report.all('payment_log', { page_size: 5 })becomesReport.all({ type: 'payment_log', page_size: 5 }).Report.allhas taken a single params object withtypesince v6 (report_service.ts#L41).@easypost/apifrom^8.9.0to^9.2.0(package.jsonandpackage-lock.json). v9 no longer depends onsuperagent, 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/list.jsusesBilling.retrievePaymentMethods(billing_service.js#L48).smartrate/retrieve-time-in-transit-statistics.jsusesgetSmartRates(shipment_service.js#L112).luma/buy.jsandluma/one-call-buy.jsuseShipment.buyLumaandShipment.createAndBuyLuma(shipment_service.js#L289-L311).luma/promise.jsusesLuma.getPromise(luma_service.js#L14).endshipper/buy.jsdrops the carbon offset arg (shipment_service.js#L35).reports/list.jspasses{ type, page_size }(report_service.js#L26).v7:billing/list.js,smartrate/retrieve-time-in-transit-statistics.js,endshipper/buy.jsandreports/list.jsget the same fixes asv8(billing_service.js#L48, shipment_service.js#L35, shipment_service.js#L112, report_service.js#L26).billing/create-ep-credit-card.jschangesReferral.addCreditCardtoReferralCustomer.addCreditCard, with the same arguments (referral_customer_service.js#L134).v6:billing/list.jsusesBilling.retrievePaymentMethods(billing_service.js#L48).reports/list.jspasses{ type, page_size }(report_service.js#L26).billing/create-ep-credit-card.jsusesReferralCustomer.addCreditCard(referral_customer_service.js#L135). Theendshipper/buy.jscarbon offset arg is correct for v6 and is unchanged (shipment_service.js#L38-L43).v5:billing/list.jsusesBilling.retrievePaymentMethods(billing.js#L48). Thev5endshipper and report snippets already match v5's signatures and are unchanged.v8/billing/retrieve-stripe-public-key.jsis 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.