Skip to content

Add createShipment and cancelShipment for v0.3.0#2

Merged
freshlogic merged 3 commits into
mainfrom
v0.3.0-create-cancel-shipment
May 14, 2026
Merged

Add createShipment and cancelShipment for v0.3.0#2
freshlogic merged 3 commits into
mainfrom
v0.3.0-create-cancel-shipment

Conversation

@farhatraiyan
Copy link
Copy Markdown
Collaborator

@farhatraiyan farhatraiyan commented May 13, 2026

Summary

  • Add createShipment(shipRequest, options)POST /ship/v1/shipments (REST equivalent of SOAP processShipment)
  • Add cancelShipment(cancelRequest, options)PUT /ship/v1/shipments/cancel (REST equivalent of SOAP deleteShipment)

Both methods are consumer-agnostic: the caller supplies the full request body and the package forwards it verbatim, same as the pre-existing rateAndTransitTimes and validateAddress methods. 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 cancelShipment integration test chains a real create→cancel round-trip to validate both endpoints end-to-end. Mocked tests cover header forwarding, HTTP method verification (POST for create, PUT for cancel), and error handling (200-with-errors[] envelope and non-2xx responses).

Test plan

  • 35 tests pass (all integration + mocked), 0 fail
  • ESLint clean
  • createShipment integration test creates a FedEx Ground shipment against sandbox and asserts transactionId and output
  • cancelShipment integration test chains create→cancel against sandbox using the tracking number from the created shipment
  • 3 mocked tests per method: header/method verification, errors envelope, non-2xx
  • CI passes with sandbox credentials

🤖 Generated with Claude Code

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>
@coveralls
Copy link
Copy Markdown

coveralls commented May 13, 2026

Coverage Report for CI Build 25837686645

Coverage remained the same at 100.0%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 90 of 90 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 233
Covered Lines: 233
Line Coverage: 100.0%
Relevant Branches: 36
Covered Branches: 36
Branch Coverage: 100.0%
Branches in Coverage %: Yes
Coverage Strength: 12.85 hits per line

💛 - Coveralls

freshlogic and others added 2 commits May 13, 2026 20:38
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>
@freshlogic freshlogic merged commit b7b749f into main May 14, 2026
2 checks passed
@farhatraiyan farhatraiyan deleted the v0.3.0-create-cancel-shipment branch May 14, 2026 15:13
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