@mpgd/platform 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +26 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -64,6 +64,31 @@ export interface AdAdapter {
64
64
  readonly placementId: LogicalAdPlacementId;
65
65
  }): Promise<InterstitialAdResult>;
66
66
  }
67
+ export type PromotionRewardAvailability = 'available' | 'configuration-required' | 'unsupported';
68
+ export type PromotionRewardResult = {
69
+ readonly status: 'granted';
70
+ /** Opaque provider receipt used by the game backend to finalize the authorized claim. */
71
+ readonly receiptKey: string;
72
+ } | {
73
+ readonly status: 'pending' | 'unavailable' | 'failed';
74
+ };
75
+ /**
76
+ * Optional platform-funded promotion surface.
77
+ *
78
+ * Games address logical campaign ids only. Platform promotion codes and reward
79
+ * amounts belong to the target host configuration, while claim authorization
80
+ * and receipt finalization remain server responsibilities.
81
+ */
82
+ export interface PromotionRewardAdapter {
83
+ getAvailability(input: {
84
+ readonly campaignId: string;
85
+ }): Promise<PromotionRewardAvailability>;
86
+ grantReward(input: {
87
+ readonly campaignId: string;
88
+ /** Server-issued, single-use claim id. */
89
+ readonly idempotencyKey: string;
90
+ }): Promise<PromotionRewardResult>;
91
+ }
67
92
  export interface LeaderboardScoreInput {
68
93
  readonly leaderboardId: string;
69
94
  readonly score: number;
@@ -200,5 +225,6 @@ export interface PlatformGateway {
200
225
  readonly presentation?: PresentationAdapter;
201
226
  readonly sharing?: ShareAdapter;
202
227
  readonly notifications?: NotificationSubscriptionAdapter;
228
+ readonly promotions?: PromotionRewardAdapter;
203
229
  }
204
230
  export declare function createUnsupportedCapabilities(): PlatformCapabilities;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/platform",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Shared platform gateway, monetization, ads, leaderboard, identity, lifecycle, and storage contracts for mpgd games.",
5
5
  "license": "MIT",
6
6
  "repository": {