Skip to content

Export ConsumptionRequestReason from the package entry point; consider exposing FirstSendAttemptResult for consistency #449

Description

@abhinavgautam01

Description

ConsumptionRequestReason is a defined enum used by the public Data.consumptionRequestReason field, but index.ts does not re-export it. Consumers cannot import the enum from @apple/app-store-server-library, even though they can receive values of that field in decoded notifications.

Consumers must currently use string literals or import the enum through an internal distribution path. This is inconsistent with the package's public exports for other notification-related enums.

FirstSendAttemptResult is also defined but not re-exported. Unlike ConsumptionRequestReason, it is not referenced by any current model in this revision. Exposing it is therefore a separate API-consistency consideration, not evidence that a current model's enum is inaccessible. If that enum is obsolete, maintainers may prefer to clarify its status rather than add it to the public API.

Reproduction

Compile this consumer code:

import {
  ConsumptionRequestReason,
  FirstSendAttemptResult,
} from '@apple/app-store-server-library';

console.log(ConsumptionRequestReason.UNINTENDED_PURCHASE);
console.log(FirstSendAttemptResult.SUCCESS);

Both imports fail with a missing-export diagnostic. TypeScript 5.9.3 reported TS2724 for each symbol under both moduleResolution: "NodeNext" and moduleResolution: "Bundler".

Existing exports such as Environment and SignedDataVerifier compile successfully in the same consumer configurations, isolating the problem to the missing symbols.

Expected behavior

Consumers should be able to import ConsumptionRequestReason from the package entry point and compare notification data against its named values.

Suggested change

Add the missing public export:

export { ConsumptionRequestReason } from './models/ConsumptionRequestReason';

If FirstSendAttemptResult is intended to remain a supported public enum, also add:

export { FirstSendAttemptResult } from './models/FirstSendAttemptResult';

Verify that the package's emitted JavaScript and declarations expose the intended symbols to package-root imports.

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