Skip to content

SDK alignment day: type PrescriptionEnvelope, fix getPrescription wrapper, contract tests #6

Description

@DrAlexHarrison

The SDK's prescription typings lag the API contract in three places:

  • activities.calculatePrescription is typed Promise<NutritionCalculateResponse>. The tier, teaser and trial fields match, but full-tier exact values now live under .prescription.
  • activities.getPrescription returns a {prescription, safety} wrapper, not a bare NutritionCalculateResponse.
  • The activity import response now carries prescriptions[] (one tier-aware envelope per item) and the request accepts calculate flags, globally and per activity. Batch endpoints debit rate limits per work item, which the client docs should say.

Definition of done: a typed PrescriptionEnvelope, the corrected getPrescription return type, import-time calculate support, and a contract test against the sandbox environment so the typings cannot drift silently.

Until this lands, the curl examples in the quickstart are the reference for these shapes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions