Add createShipment and cancelShipment for v0.3.0#2
Merged
Conversation
REST equivalents of SOAP processShipment and deleteShipment operations. createShipment (POST /ship/v1/shipments) and cancelShipment (PUT /ship/v1/shipments/cancel) follow the same verbatim passthrough pattern as existing methods. Integration tests chain create→cancel against the FedEx sandbox. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Coverage Report for CI Build 25837686645Coverage remained the same at 100.0%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
The "REST equivalent of the SOAP processShipment/deleteShipment operation" qualifier doesn't help readers using this package; this is a REST client, not a migration aid. The remaining "caller supplies the full request body, package forwards verbatim" wording is the same passthrough description used for rateAndTransitTimes and validateAddress. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ption - index.js: reorder methods to cancelShipment, createShipment, getAccessToken, rateAndTransitTimes, validateAddress. - README.md: reorder the same sections to match; alphabetize the comma-list in the package description line. - package.json: alphabetize the comma-list in description. - test/index.js: reorder the 9 outer test() blocks to match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
createShipment(shipRequest, options)—POST /ship/v1/shipments(REST equivalent of SOAPprocessShipment)cancelShipment(cancelRequest, options)—PUT /ship/v1/shipments/cancel(REST equivalent of SOAPdeleteShipment)Both methods are consumer-agnostic: the caller supplies the full request body and the package forwards it verbatim, same as the pre-existing
rateAndTransitTimesandvalidateAddressmethods. This keeps the API surface minimal while supporting any combination of fields the consumer needs (label formats, service types, SmartPost details, third-party billing, etc.) without the package having to model them.Integration tests assert the request shapes derived from existing consumer usage against live FedEx sandbox API responses. The
cancelShipmentintegration test chains a real create→cancel round-trip to validate both endpoints end-to-end. Mocked tests cover header forwarding, HTTP method verification (POSTfor create,PUTfor cancel), and error handling (200-with-errors[]envelope and non-2xx responses).Test plan
createShipmentintegration test creates a FedEx Ground shipment against sandbox and assertstransactionIdandoutputcancelShipmentintegration test chains create→cancel against sandbox using the tracking number from the created shipment🤖 Generated with Claude Code