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

オープン 初心者向け
#449 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
api

調査の方向性

index.ts から始め、通知関連のエクスポートを models/ConsumptionRequestReason および models/FirstSendAttemptResult と比較します。issue の TypeScript コンシューマー例をコンパイルし、次にパッケージをビルドして、パッケージルートからのインポートが出力された JavaScript ファイルと宣言ファイルで機能することを確認します。FirstSendAttemptResult の意図されたステータスは、公開する前に解決しておく必要があります。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
388
フォーク
88
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apple/app-store-server-library-node のほかの issue

apple/app-store-server-library-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。