@mpgd/game-services 0.15.0 → 0.15.1
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.
- package/README.md +6 -0
- package/dist/operation-results.d.ts +21 -0
- package/dist/operation-results.js +1 -0
- package/dist/operations.d.ts +1 -1
- package/dist/types.d.ts +2 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,12 @@ verification and ledger boundaries.
|
|
|
11
11
|
compatible. Types are available from `@mpgd/game-services/client` and the package
|
|
12
12
|
root. No UI runtime or Phaser dependency is added.
|
|
13
13
|
|
|
14
|
+
Headless consumers can import `GameServicesOperationClient` and operation types
|
|
15
|
+
from `@mpgd/game-services/operations`. This entrypoint's declarations support
|
|
16
|
+
`lib: ["ES2022"]`, `types: []`, and `skipLibCheck: false`; they do not require
|
|
17
|
+
catalog validators, transport declarations, or DOM globals. Existing response
|
|
18
|
+
type exports from `@mpgd/game-services/types` remain compatible.
|
|
19
|
+
|
|
14
20
|
```ts
|
|
15
21
|
await client.purchase(input, {
|
|
16
22
|
correlationId: 'view-operation-42',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Shared response shapes with no schema, DOM or transport dependencies. */
|
|
2
|
+
export interface VerifyPurchaseResponse {
|
|
3
|
+
readonly verified: boolean;
|
|
4
|
+
readonly ledgerEntryId?: string;
|
|
5
|
+
readonly alreadyProcessed: boolean;
|
|
6
|
+
readonly reason?: string;
|
|
7
|
+
readonly finalization?: PurchaseGrantFinalization;
|
|
8
|
+
}
|
|
9
|
+
export type PurchaseGrantFinalizationAction = 'acknowledge' | 'consume' | 'finish' | 'complete';
|
|
10
|
+
export interface PurchaseGrantFinalization {
|
|
11
|
+
readonly status: 'completed' | 'pending';
|
|
12
|
+
readonly action?: PurchaseGrantFinalizationAction;
|
|
13
|
+
readonly alreadyCompleted: boolean;
|
|
14
|
+
readonly reason?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ClaimAdRewardResponse {
|
|
17
|
+
readonly granted: boolean;
|
|
18
|
+
readonly ledgerEntryId?: string;
|
|
19
|
+
readonly alreadyProcessed: boolean;
|
|
20
|
+
readonly reason?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/operations.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LogicalAdPlacementId, LogicalProductId, PurchaseResult, RewardedAdResult } from '@mpgd/platform';
|
|
2
2
|
import type { GameServicesOperationOptions, GameServicesPurchaseProgress, GameServicesRewardedAdProgress } from './operation-progress.js';
|
|
3
|
-
import type { ClaimAdRewardResponse, VerifyPurchaseResponse } from './
|
|
3
|
+
import type { ClaimAdRewardResponse, VerifyPurchaseResponse } from './operation-results.js';
|
|
4
4
|
export type { GameServicesOperationKind, GameServicesOperationLocation, GameServicesOperationOptions, GameServicesOperationProgress, GameServicesPurchaseProgress, GameServicesRewardedAdProgress, } from './operation-progress.js';
|
|
5
5
|
/** DOM-free public operation port, implemented by GameServicesClient. */
|
|
6
6
|
export interface GameServicesOperationClient {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ProductGrant } from '@mpgd/catalog';
|
|
2
2
|
import type { LeaderboardScoreInput, LogicalAdPlacementId, LogicalProductId, PlatformEvidenceEnvelope, PlatformTarget } from '@mpgd/platform';
|
|
3
|
+
import type { ClaimAdRewardResponse, PurchaseGrantFinalization, VerifyPurchaseResponse } from './operation-results.js';
|
|
4
|
+
export type { ClaimAdRewardResponse, PurchaseGrantFinalization, PurchaseGrantFinalizationAction, VerifyPurchaseResponse, } from './operation-results.js';
|
|
3
5
|
export type { PlatformEvidenceEnvelope } from '@mpgd/platform';
|
|
4
6
|
export type GameServicesStoreTarget = Extract<PlatformTarget, 'microsoft-store' | 'android' | 'ios' | 'ait'>;
|
|
5
7
|
export type GameServicesAdRewardTarget = Extract<PlatformTarget, 'android' | 'ios' | 'ait' | 'verse8'>;
|
|
@@ -21,20 +23,6 @@ export interface VerifyPurchaseRequest {
|
|
|
21
23
|
readonly purchasedAt: string;
|
|
22
24
|
readonly evidence?: PlatformEvidenceEnvelope;
|
|
23
25
|
}
|
|
24
|
-
export interface VerifyPurchaseResponse {
|
|
25
|
-
readonly verified: boolean;
|
|
26
|
-
readonly ledgerEntryId?: string;
|
|
27
|
-
readonly alreadyProcessed: boolean;
|
|
28
|
-
readonly reason?: string;
|
|
29
|
-
readonly finalization?: PurchaseGrantFinalization;
|
|
30
|
-
}
|
|
31
|
-
export type PurchaseGrantFinalizationAction = 'acknowledge' | 'consume' | 'finish' | 'complete';
|
|
32
|
-
export interface PurchaseGrantFinalization {
|
|
33
|
-
readonly status: 'completed' | 'pending';
|
|
34
|
-
readonly action?: PurchaseGrantFinalizationAction;
|
|
35
|
-
readonly alreadyCompleted: boolean;
|
|
36
|
-
readonly reason?: string;
|
|
37
|
-
}
|
|
38
26
|
export interface ClaimAdRewardRequest {
|
|
39
27
|
readonly target: GameServicesAdRewardTarget;
|
|
40
28
|
/** Deployment config key used to resolve game-owned platform placement identifiers. */
|
|
@@ -47,12 +35,6 @@ export interface ClaimAdRewardRequest {
|
|
|
47
35
|
readonly completedAt: string;
|
|
48
36
|
readonly evidence?: PlatformEvidenceEnvelope;
|
|
49
37
|
}
|
|
50
|
-
export interface ClaimAdRewardResponse {
|
|
51
|
-
readonly granted: boolean;
|
|
52
|
-
readonly ledgerEntryId?: string;
|
|
53
|
-
readonly alreadyProcessed: boolean;
|
|
54
|
-
readonly reason?: string;
|
|
55
|
-
}
|
|
56
38
|
export interface RecordLeaderboardScoreRequest extends LeaderboardScoreInput {
|
|
57
39
|
readonly target: GameServicesLeaderboardTarget;
|
|
58
40
|
readonly playerId: string;
|