@gpc-cli/api 1.0.27 → 1.0.29
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 +72 -248
- package/dist/index.d.ts +129 -33
- package/dist/index.js +149 -63
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Typed Google Play Developer API v3 client for TypeScript. Part of [GPC](https://github.com/yasserstudio/gpc).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
215 endpoints across edits, releases, tracks, listings, subscriptions, in-app products, purchases, reviews, vitals, reports, users, and testers. Built-in rate limiting, retry logic, and pagination.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -19,204 +19,53 @@ import { resolveAuth } from "@gpc-cli/auth";
|
|
|
19
19
|
const auth = await resolveAuth({
|
|
20
20
|
serviceAccountPath: "./service-account.json",
|
|
21
21
|
});
|
|
22
|
-
|
|
23
22
|
const client = createApiClient({ auth });
|
|
24
23
|
|
|
25
|
-
// List all tracks
|
|
26
24
|
const edit = await client.edits.insert("com.example.app");
|
|
27
25
|
const tracks = await client.tracks.list("com.example.app", edit.id);
|
|
28
26
|
console.log(tracks);
|
|
29
|
-
|
|
30
27
|
await client.edits.delete("com.example.app", edit.id);
|
|
31
28
|
```
|
|
32
29
|
|
|
33
30
|
## Client Factories
|
|
34
31
|
|
|
35
|
-
| Factory | Purpose
|
|
36
|
-
| -------------------------------- |
|
|
37
|
-
| `createApiClient(options)` | Core Play API
|
|
38
|
-
| `createReportingClient(options)` | Vitals, crash rates, ANR, error reporting
|
|
39
|
-
| `createUsersClient(options)` | Developer account users and permission grants
|
|
40
|
-
| `createHttpClient(options)` | Low-level HTTP with auth, retry, and rate limiting
|
|
41
|
-
|
|
42
|
-
All factories accept `ApiClientOptions`:
|
|
32
|
+
| Factory | Purpose |
|
|
33
|
+
| -------------------------------- | ---------------------------------------------------------------- |
|
|
34
|
+
| `createApiClient(options)` | Core Play API: apps, releases, listings, monetization, purchases |
|
|
35
|
+
| `createReportingClient(options)` | Vitals, crash rates, ANR, error reporting |
|
|
36
|
+
| `createUsersClient(options)` | Developer account users and permission grants |
|
|
37
|
+
| `createHttpClient(options)` | Low-level HTTP with auth, retry, and rate limiting |
|
|
43
38
|
|
|
44
39
|
```typescript
|
|
45
|
-
import type { ApiClientOptions } from "@gpc-cli/api";
|
|
46
|
-
|
|
47
40
|
const options: ApiClientOptions = {
|
|
48
41
|
auth, // Required: { getAccessToken(): Promise<string> }
|
|
49
42
|
maxRetries: 3, // Default retry count
|
|
50
43
|
timeout: 30_000, // Request timeout in ms
|
|
51
|
-
|
|
52
|
-
onRetry: (entry) => console.warn(`Retry #${entry.attempt}: ${entry.error}`),
|
|
44
|
+
onRetry: (entry) => console.warn(`Retry #${entry.attempt}`),
|
|
53
45
|
};
|
|
54
46
|
```
|
|
55
47
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
### Edits
|
|
59
|
-
|
|
60
|
-
Every modification to app metadata, tracks, or listings requires an edit session.
|
|
61
|
-
|
|
62
|
-
```typescript
|
|
63
|
-
const edit = await client.edits.insert("com.example.app");
|
|
64
|
-
|
|
65
|
-
// ... make changes within the edit ...
|
|
48
|
+
## Common Workflows
|
|
66
49
|
|
|
67
|
-
|
|
68
|
-
await client.edits.commit("com.example.app", edit.id);
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Bundles
|
|
50
|
+
### Upload and release
|
|
72
51
|
|
|
73
52
|
```typescript
|
|
74
53
|
const edit = await client.edits.insert("com.example.app");
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
await client.edits.commit("com.example.app", edit.id);
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Tracks & Releases
|
|
81
|
-
|
|
82
|
-
```typescript
|
|
83
|
-
const edit = await client.edits.insert("com.example.app");
|
|
84
|
-
|
|
85
|
-
const tracks = await client.tracks.list("com.example.app", edit.id);
|
|
86
|
-
const production = await client.tracks.get("com.example.app", edit.id, "production");
|
|
87
|
-
|
|
88
|
-
await client.tracks.update("com.example.app", edit.id, "production", {
|
|
54
|
+
await client.bundles.upload("com.example.app", edit.id, "./app.aab");
|
|
55
|
+
await client.tracks.update("com.example.app", edit.id, "beta", {
|
|
89
56
|
versionCodes: ["42"],
|
|
90
|
-
status: "
|
|
91
|
-
userFraction: 0.1,
|
|
57
|
+
status: "completed",
|
|
92
58
|
releaseNotes: [{ language: "en-US", text: "Bug fixes" }],
|
|
93
59
|
});
|
|
94
|
-
|
|
95
|
-
await client.edits.commit("com.example.app", edit.id);
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Listings
|
|
99
|
-
|
|
100
|
-
```typescript
|
|
101
|
-
const edit = await client.edits.insert("com.example.app");
|
|
102
|
-
|
|
103
|
-
const listings = await client.listings.list("com.example.app", edit.id);
|
|
104
|
-
const en = await client.listings.get("com.example.app", edit.id, "en-US");
|
|
105
|
-
|
|
106
|
-
await client.listings.update("com.example.app", edit.id, "en-US", {
|
|
107
|
-
title: "My App",
|
|
108
|
-
shortDescription: "A great app",
|
|
109
|
-
fullDescription: "Full description here...",
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
await client.edits.commit("com.example.app", edit.id);
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### Images
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
const edit = await client.edits.insert("com.example.app");
|
|
119
|
-
|
|
120
|
-
const screenshots = await client.images.list(
|
|
121
|
-
"com.example.app",
|
|
122
|
-
edit.id,
|
|
123
|
-
"en-US",
|
|
124
|
-
"phoneScreenshots",
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
await client.images.upload("com.example.app", edit.id, "en-US", "featureGraphic", "./feature.png");
|
|
128
|
-
|
|
129
|
-
await client.images.deleteAll("com.example.app", edit.id, "en-US", "phoneScreenshots");
|
|
130
60
|
await client.edits.commit("com.example.app", edit.id);
|
|
131
61
|
```
|
|
132
62
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
### Subscriptions
|
|
136
|
-
|
|
137
|
-
```typescript
|
|
138
|
-
const { subscriptions } = await client.subscriptions.list("com.example.app");
|
|
139
|
-
const sub = await client.subscriptions.get("com.example.app", "premium_monthly");
|
|
140
|
-
|
|
141
|
-
await client.subscriptions.activateBasePlan("com.example.app", "premium_monthly", "p1m");
|
|
142
|
-
await client.subscriptions.deactivateBasePlan("com.example.app", "premium_monthly", "p1m");
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Subscription Offers
|
|
146
|
-
|
|
147
|
-
```typescript
|
|
148
|
-
const { subscriptionOffers } = await client.subscriptions.listOffers(
|
|
149
|
-
"com.example.app",
|
|
150
|
-
"premium_monthly",
|
|
151
|
-
"p1m",
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
const offer = await client.subscriptions.getOffer(
|
|
155
|
-
"com.example.app",
|
|
156
|
-
"premium_monthly",
|
|
157
|
-
"p1m",
|
|
158
|
-
"intro_offer",
|
|
159
|
-
);
|
|
160
|
-
|
|
161
|
-
await client.subscriptions.activateOffer(
|
|
162
|
-
"com.example.app",
|
|
163
|
-
"premium_monthly",
|
|
164
|
-
"p1m",
|
|
165
|
-
"intro_offer",
|
|
166
|
-
);
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### In-App Products
|
|
170
|
-
|
|
171
|
-
```typescript
|
|
172
|
-
const { inappproduct } = await client.inappproducts.list("com.example.app");
|
|
173
|
-
const product = await client.inappproducts.get("com.example.app", "coins_100");
|
|
174
|
-
|
|
175
|
-
await client.inappproducts.create("com.example.app", {
|
|
176
|
-
sku: "coins_500",
|
|
177
|
-
status: "active",
|
|
178
|
-
purchaseType: "managedUser",
|
|
179
|
-
defaultPrice: { currencyCode: "USD", units: "4", nanos: 990_000_000 },
|
|
180
|
-
});
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### Purchases
|
|
184
|
-
|
|
185
|
-
```typescript
|
|
186
|
-
// Verify a product purchase
|
|
187
|
-
const purchase = await client.purchases.getProduct("com.example.app", "coins_100", purchaseToken);
|
|
188
|
-
|
|
189
|
-
// Acknowledge it
|
|
190
|
-
await client.purchases.acknowledgeProduct("com.example.app", "coins_100", purchaseToken);
|
|
191
|
-
|
|
192
|
-
// Verify a subscription (v2)
|
|
193
|
-
const sub = await client.purchases.getSubscriptionV2("com.example.app", purchaseToken);
|
|
194
|
-
|
|
195
|
-
// List voided purchases
|
|
196
|
-
const { voidedPurchases } = await client.purchases.listVoided("com.example.app", {
|
|
197
|
-
startTime: "1700000000000",
|
|
198
|
-
maxResults: 100,
|
|
199
|
-
});
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Reviews
|
|
203
|
-
|
|
204
|
-
```typescript
|
|
205
|
-
const { reviews } = await client.reviews.list("com.example.app", { maxResults: 50 });
|
|
206
|
-
const review = await client.reviews.get("com.example.app", reviewId);
|
|
207
|
-
await client.reviews.reply("com.example.app", reviewId, "Thanks for the feedback!");
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### Vitals & Error Reporting
|
|
211
|
-
|
|
212
|
-
Uses a separate client that targets the Play Developer Reporting API.
|
|
63
|
+
### Query crash rates
|
|
213
64
|
|
|
214
65
|
```typescript
|
|
215
66
|
import { createReportingClient } from "@gpc-cli/api";
|
|
216
67
|
|
|
217
68
|
const reporting = createReportingClient({ auth });
|
|
218
|
-
|
|
219
|
-
// Query crash rate
|
|
220
69
|
const crashes = await reporting.queryMetricSet("com.example.app", "crashRateMetricSet", {
|
|
221
70
|
metrics: ["crashRate", "userPerceivedCrashRate"],
|
|
222
71
|
timelineSpec: {
|
|
@@ -225,75 +74,52 @@ const crashes = await reporting.queryMetricSet("com.example.app", "crashRateMetr
|
|
|
225
74
|
endTime: { year: 2026, month: 3, day: 1 },
|
|
226
75
|
},
|
|
227
76
|
});
|
|
228
|
-
|
|
229
|
-
// Detect anomalies
|
|
230
|
-
const { anomalies } = await reporting.getAnomalies("com.example.app");
|
|
231
|
-
|
|
232
|
-
// Search error issues
|
|
233
|
-
const { errorIssues } = await reporting.searchErrorIssues("com.example.app");
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
Available metric sets: `crashRateMetricSet`, `anrRateMetricSet`, `excessiveWakeupRateMetricSet`, `stuckBackgroundWakelockRateMetricSet`, `slowStartRateMetricSet`, `slowRenderingRateMetricSet`, `errorCountMetricSet`.
|
|
237
|
-
|
|
238
|
-
### Reports
|
|
239
|
-
|
|
240
|
-
```typescript
|
|
241
|
-
const { reports } = await client.reports.list("com.example.app", "earnings", 2026, 2);
|
|
242
77
|
```
|
|
243
78
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
### Users & Grants
|
|
247
|
-
|
|
248
|
-
Uses a separate client for developer account management.
|
|
79
|
+
### Manage subscriptions
|
|
249
80
|
|
|
250
81
|
```typescript
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const users = createUsersClient({ auth });
|
|
254
|
-
|
|
255
|
-
const { users: devUsers } = await users.list(developerId);
|
|
256
|
-
const user = await users.get(developerId, userId);
|
|
257
|
-
|
|
258
|
-
await users.create(developerId, {
|
|
259
|
-
email: "dev@example.com",
|
|
260
|
-
developerAccountPermission: ["CAN_MANAGE_PUBLIC_APKS", "CAN_REPLY_TO_REVIEWS"],
|
|
261
|
-
});
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
### Testers
|
|
265
|
-
|
|
266
|
-
```typescript
|
|
267
|
-
const edit = await client.edits.insert("com.example.app");
|
|
268
|
-
const testers = await client.testers.get("com.example.app", edit.id, "internal");
|
|
269
|
-
|
|
270
|
-
await client.testers.update("com.example.app", edit.id, "internal", {
|
|
271
|
-
googleGroups: ["testers@example.com"],
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
await client.edits.commit("com.example.app", edit.id);
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### Monetization
|
|
278
|
-
|
|
279
|
-
```typescript
|
|
280
|
-
const { convertedRegionPrices } = await client.monetization.convertRegionPrices("com.example.app", {
|
|
281
|
-
price: { currencyCode: "USD", units: "9", nanos: 990_000_000 },
|
|
282
|
-
});
|
|
82
|
+
const { subscriptions } = await client.subscriptions.list("com.example.app");
|
|
83
|
+
await client.subscriptions.activateBasePlan("com.example.app", "premium_monthly", "p1m");
|
|
283
84
|
```
|
|
284
85
|
|
|
285
|
-
###
|
|
286
|
-
|
|
287
|
-
```typescript
|
|
288
|
-
const
|
|
289
|
-
await client.
|
|
290
|
-
|
|
291
|
-
|
|
86
|
+
### Verify purchases
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
const purchase = await client.purchases.getProduct("com.example.app", "coins_100", token);
|
|
90
|
+
await client.purchases.acknowledgeProduct("com.example.app", "coins_100", token);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## All API Modules
|
|
94
|
+
|
|
95
|
+
| Module | Methods |
|
|
96
|
+
| ----------------------------- | ----------------------------------------------------------------------------------------- |
|
|
97
|
+
| `client.edits` | insert, get, validate, commit, delete |
|
|
98
|
+
| `client.bundles` | upload, list |
|
|
99
|
+
| `client.tracks` | list, get, update |
|
|
100
|
+
| `client.listings` | list, get, update, delete, deleteAll |
|
|
101
|
+
| `client.images` | list, upload, delete, deleteAll |
|
|
102
|
+
| `client.subscriptions` | list, get, create, patch, archive, activate/deactivate base plans and offers |
|
|
103
|
+
| `client.inappproducts` | list, get, create, update, delete, batchGet, batchUpdate, batchDelete |
|
|
104
|
+
| `client.oneTimeProducts` | list, get, create, patch, delete, batchGet, batchUpdate, batchDelete |
|
|
105
|
+
| `client.purchases` | getProduct, acknowledgeProduct, getSubscriptionV2, revokeSubscription, refund, listVoided |
|
|
106
|
+
| `client.reviews` | list, get, reply |
|
|
107
|
+
| `client.testers` | get, update |
|
|
108
|
+
| `client.reports` | list |
|
|
109
|
+
| `client.monetization` | convertRegionPrices |
|
|
110
|
+
| `client.deobfuscation` | upload |
|
|
111
|
+
| `client.expansionFiles` | get, update, patch, upload |
|
|
112
|
+
| `client.dataSafety` | get, update |
|
|
113
|
+
| `client.deviceTiers` | list, get, create |
|
|
114
|
+
| `client.internalSharing` | uploadBundle, uploadApk |
|
|
115
|
+
| `client.generatedApks` | list, download |
|
|
116
|
+
| `client.externalTransactions` | create, get, refund |
|
|
117
|
+
| `client.appRecovery` | create, deploy, cancel, list |
|
|
118
|
+
| `reporting.*` | queryMetricSet, getAnomalies, searchErrorIssues, searchErrorReports |
|
|
119
|
+
| `users.*` | list, get, create, patch, delete, listGrants, createGrant, patchGrant, deleteGrant |
|
|
292
120
|
|
|
293
121
|
## Pagination
|
|
294
122
|
|
|
295
|
-
Built-in helpers for paginated endpoints:
|
|
296
|
-
|
|
297
123
|
```typescript
|
|
298
124
|
import { paginateAll } from "@gpc-cli/api";
|
|
299
125
|
|
|
@@ -309,9 +135,27 @@ const allReviews = await paginateAll(async (pageToken) => {
|
|
|
309
135
|
});
|
|
310
136
|
```
|
|
311
137
|
|
|
138
|
+
## Error Handling
|
|
139
|
+
|
|
140
|
+
API errors throw `ApiError` with a code, HTTP status, and actionable suggestion. Retries are automatic for 429 and 5xx with exponential backoff and jitter.
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
import { ApiError } from "@gpc-cli/api";
|
|
144
|
+
|
|
145
|
+
try {
|
|
146
|
+
await client.tracks.get("com.example.app", editId, "production");
|
|
147
|
+
} catch (error) {
|
|
148
|
+
if (error instanceof ApiError) {
|
|
149
|
+
console.error(error.code); // "API_NOT_FOUND"
|
|
150
|
+
console.error(error.statusCode); // 404
|
|
151
|
+
console.error(error.suggestion); // actionable fix
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
312
156
|
## Type Exports
|
|
313
157
|
|
|
314
|
-
All Google Play API types are exported
|
|
158
|
+
All Google Play API types are exported:
|
|
315
159
|
|
|
316
160
|
```typescript
|
|
317
161
|
import type {
|
|
@@ -342,31 +186,11 @@ import type {
|
|
|
342
186
|
} from "@gpc-cli/api";
|
|
343
187
|
```
|
|
344
188
|
|
|
345
|
-
## Error Handling
|
|
346
|
-
|
|
347
|
-
API errors throw `ApiError` with a code, HTTP status, and actionable suggestion:
|
|
348
|
-
|
|
349
|
-
```typescript
|
|
350
|
-
import { ApiError } from "@gpc-cli/api";
|
|
351
|
-
|
|
352
|
-
try {
|
|
353
|
-
await client.tracks.get("com.example.app", editId, "production");
|
|
354
|
-
} catch (error) {
|
|
355
|
-
if (error instanceof ApiError) {
|
|
356
|
-
console.error(error.code); // e.g. "API_NOT_FOUND"
|
|
357
|
-
console.error(error.statusCode); // e.g. 404
|
|
358
|
-
console.error(error.suggestion); // actionable fix
|
|
359
|
-
console.error(error.toJSON()); // structured error object
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
Retries are automatic for 429 (rate limit) and 5xx errors with exponential backoff and jitter.
|
|
365
|
-
|
|
366
189
|
## Documentation
|
|
367
190
|
|
|
368
191
|
- [Full documentation](https://yasserstudio.github.io/gpc/)
|
|
369
|
-
- [SDK usage guide](https://yasserstudio.github.io/gpc/advanced/sdk-usage
|
|
192
|
+
- [SDK usage guide](https://yasserstudio.github.io/gpc/advanced/sdk-usage)
|
|
193
|
+
- [API coverage map](https://yasserstudio.github.io/gpc/reference/api-coverage)
|
|
370
194
|
|
|
371
195
|
## License
|
|
372
196
|
|
package/dist/index.d.ts
CHANGED
|
@@ -395,6 +395,27 @@ interface BasePlanMigratePricesRequest {
|
|
|
395
395
|
};
|
|
396
396
|
latencyTolerance?: ProductUpdateLatencyTolerance;
|
|
397
397
|
}
|
|
398
|
+
interface BatchMigratePricesRequest {
|
|
399
|
+
requests: {
|
|
400
|
+
packageName: string;
|
|
401
|
+
productId: string;
|
|
402
|
+
basePlanId: string;
|
|
403
|
+
regionalPriceMigrations: {
|
|
404
|
+
regionCode: string;
|
|
405
|
+
oldestAllowedPriceVersionTime?: string;
|
|
406
|
+
priceIncreaseType?: string;
|
|
407
|
+
}[];
|
|
408
|
+
regionsVersion?: {
|
|
409
|
+
version?: string;
|
|
410
|
+
};
|
|
411
|
+
latencyTolerance?: ProductUpdateLatencyTolerance;
|
|
412
|
+
}[];
|
|
413
|
+
}
|
|
414
|
+
interface BatchMigratePricesResponse {
|
|
415
|
+
responses: {
|
|
416
|
+
subscription?: Subscription;
|
|
417
|
+
}[];
|
|
418
|
+
}
|
|
398
419
|
interface SubscriptionOfferPhase {
|
|
399
420
|
recurrenceCount: number;
|
|
400
421
|
duration: string;
|
|
@@ -888,14 +909,26 @@ interface TaxAndComplianceSettings {
|
|
|
888
909
|
interface OneTimeOffer {
|
|
889
910
|
packageName: string;
|
|
890
911
|
productId: string;
|
|
912
|
+
purchaseOptionId: string;
|
|
891
913
|
offerId: string;
|
|
892
|
-
|
|
914
|
+
state?: "DRAFT" | "ACTIVE" | "CANCELLED" | "INACTIVE";
|
|
915
|
+
regionalPricingAndAvailabilityConfigs?: Record<string, OneTimeOfferRegionalConfig>;
|
|
916
|
+
/** @deprecated Use regionalPricingAndAvailabilityConfigs instead */
|
|
917
|
+
regionalConfigs?: Record<string, OneTimeOfferRegionalConfig>;
|
|
893
918
|
otherRegionsConfig?: {
|
|
894
919
|
usdPrice: {
|
|
895
920
|
units: string;
|
|
896
921
|
nanos?: number;
|
|
897
922
|
};
|
|
898
923
|
};
|
|
924
|
+
offerTags?: Array<{
|
|
925
|
+
tag: string;
|
|
926
|
+
}>;
|
|
927
|
+
regionsVersion?: {
|
|
928
|
+
version: string;
|
|
929
|
+
};
|
|
930
|
+
preOrderOffer?: Record<string, unknown>;
|
|
931
|
+
discountedOffer?: Record<string, unknown>;
|
|
899
932
|
}
|
|
900
933
|
interface OneTimeOfferRegionalConfig {
|
|
901
934
|
price: {
|
|
@@ -910,25 +943,25 @@ interface OneTimeProductsListResponse {
|
|
|
910
943
|
nextPageToken?: string;
|
|
911
944
|
}
|
|
912
945
|
interface OneTimeOffersListResponse {
|
|
913
|
-
|
|
946
|
+
oneTimeProductOffers?: OneTimeOffer[];
|
|
947
|
+
/** @deprecated Use oneTimeProductOffers */
|
|
948
|
+
oneTimeOffers?: OneTimeOffer[];
|
|
914
949
|
nextPageToken?: string;
|
|
915
950
|
}
|
|
916
|
-
interface
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
stateInfo?: {
|
|
921
|
-
activeState?: Record<string, unknown>;
|
|
922
|
-
inactiveState?: Record<string, unknown>;
|
|
923
|
-
};
|
|
924
|
-
listings?: Record<string, {
|
|
925
|
-
title: string;
|
|
926
|
-
description?: string;
|
|
927
|
-
}>;
|
|
951
|
+
interface SystemApkDeviceSpec {
|
|
952
|
+
supportedAbis?: string[];
|
|
953
|
+
supportedLocales?: string[];
|
|
954
|
+
screenDensity?: number;
|
|
928
955
|
}
|
|
929
|
-
interface
|
|
930
|
-
|
|
931
|
-
|
|
956
|
+
interface SystemApkOptions {
|
|
957
|
+
uncompressedNativeLibraries?: boolean;
|
|
958
|
+
uncompressedDexFiles?: boolean;
|
|
959
|
+
rotated?: boolean;
|
|
960
|
+
}
|
|
961
|
+
interface SystemApkVariant {
|
|
962
|
+
variantId?: number;
|
|
963
|
+
deviceSpec?: SystemApkDeviceSpec;
|
|
964
|
+
options?: SystemApkOptions;
|
|
932
965
|
}
|
|
933
966
|
interface InAppProductsBatchUpdateRequest {
|
|
934
967
|
requests: {
|
|
@@ -972,7 +1005,7 @@ interface ReleaseSummary {
|
|
|
972
1005
|
activeArtifacts?: {
|
|
973
1006
|
versionCode: number;
|
|
974
1007
|
}[];
|
|
975
|
-
releaseLifecycleState?:
|
|
1008
|
+
releaseLifecycleState?: "RELEASE_LIFECYCLE_STATE_UNSPECIFIED" | "DRAFT" | "NOT_SENT_FOR_REVIEW" | "IN_REVIEW" | "APPROVED_NOT_PUBLISHED" | "NOT_APPROVED" | "PUBLISHED";
|
|
976
1009
|
}
|
|
977
1010
|
interface ReleasesListResponse {
|
|
978
1011
|
releases: ReleaseSummary[];
|
|
@@ -1085,6 +1118,7 @@ interface PlayApiClient {
|
|
|
1085
1118
|
deactivateBasePlan(packageName: string, productId: string, basePlanId: string): Promise<Subscription>;
|
|
1086
1119
|
deleteBasePlan(packageName: string, productId: string, basePlanId: string): Promise<void>;
|
|
1087
1120
|
migratePrices(packageName: string, productId: string, basePlanId: string, body: BasePlanMigratePricesRequest): Promise<Subscription>;
|
|
1121
|
+
batchMigratePrices(packageName: string, productId: string, body: BatchMigratePricesRequest): Promise<BatchMigratePricesResponse>;
|
|
1088
1122
|
listOffers(packageName: string, productId: string, basePlanId: string): Promise<OffersListResponse>;
|
|
1089
1123
|
getOffer(packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
|
|
1090
1124
|
createOffer(packageName: string, productId: string, basePlanId: string, data: SubscriptionOffer, offerId?: string, regionsVersion?: string): Promise<SubscriptionOffer>;
|
|
@@ -1138,6 +1172,10 @@ interface PlayApiClient {
|
|
|
1138
1172
|
autoConvertMissingPrices?: boolean;
|
|
1139
1173
|
allowMissing?: boolean;
|
|
1140
1174
|
}): Promise<InAppProduct>;
|
|
1175
|
+
patch(packageName: string, sku: string, data: Partial<InAppProduct>, options?: {
|
|
1176
|
+
autoConvertMissingPrices?: boolean;
|
|
1177
|
+
latencyTolerance?: string;
|
|
1178
|
+
}): Promise<InAppProduct>;
|
|
1141
1179
|
delete(packageName: string, sku: string): Promise<void>;
|
|
1142
1180
|
batchUpdate(packageName: string, requests: InAppProductsBatchUpdateRequest): Promise<InAppProductsBatchUpdateResponse>;
|
|
1143
1181
|
batchGet(packageName: string, skus: string[]): Promise<InAppProduct[]>;
|
|
@@ -1157,7 +1195,6 @@ interface PlayApiClient {
|
|
|
1157
1195
|
developerPayload?: string;
|
|
1158
1196
|
}): Promise<void>;
|
|
1159
1197
|
revokeSubscriptionV2(packageName: string, token: string): Promise<void>;
|
|
1160
|
-
refundSubscriptionV2(packageName: string, token: string): Promise<void>;
|
|
1161
1198
|
/** V2 cancel with cancellationType support. (Sep 2025) */
|
|
1162
1199
|
cancelSubscriptionV2(packageName: string, token: string, body?: SubscriptionsV2CancelRequest): Promise<void>;
|
|
1163
1200
|
/** V2 defer for subscriptions with add-ons. (Jan 2026) */
|
|
@@ -1191,6 +1228,7 @@ interface PlayApiClient {
|
|
|
1191
1228
|
testers: {
|
|
1192
1229
|
get(packageName: string, editId: string, track: string): Promise<Testers>;
|
|
1193
1230
|
update(packageName: string, editId: string, track: string, testers: Testers): Promise<Testers>;
|
|
1231
|
+
patch(packageName: string, editId: string, track: string, testers: Partial<Testers>): Promise<Testers>;
|
|
1194
1232
|
};
|
|
1195
1233
|
deobfuscation: {
|
|
1196
1234
|
upload(packageName: string, editId: string, versionCode: number, filePath: string, fileType?: DeobfuscationFileType): Promise<DeobfuscationFile>;
|
|
@@ -1221,11 +1259,11 @@ interface PlayApiClient {
|
|
|
1221
1259
|
create(packageName: string, product: OneTimeProduct, regionsVersion?: string): Promise<OneTimeProduct>;
|
|
1222
1260
|
update(packageName: string, productId: string, product: Partial<OneTimeProduct>, updateMask?: string, regionsVersion?: string, options?: MutationOptions): Promise<OneTimeProduct>;
|
|
1223
1261
|
delete(packageName: string, productId: string): Promise<void>;
|
|
1224
|
-
listOffers(packageName: string, productId: string): Promise<OneTimeOffersListResponse>;
|
|
1225
|
-
getOffer(packageName: string, productId: string, offerId: string): Promise<OneTimeOffer>;
|
|
1226
|
-
createOffer(packageName: string, productId: string, offer: OneTimeOffer, regionsVersion?: string): Promise<OneTimeOffer>;
|
|
1227
|
-
updateOffer(packageName: string, productId: string, offerId: string, offer: Partial<OneTimeOffer>, updateMask?: string, regionsVersion?: string, options?: MutationOptions): Promise<OneTimeOffer>;
|
|
1228
|
-
deleteOffer(packageName: string, productId: string, offerId: string): Promise<void>;
|
|
1262
|
+
listOffers(packageName: string, productId: string, purchaseOptionId?: string): Promise<OneTimeOffersListResponse>;
|
|
1263
|
+
getOffer(packageName: string, productId: string, purchaseOptionId: string, offerId: string): Promise<OneTimeOffer>;
|
|
1264
|
+
createOffer(packageName: string, productId: string, purchaseOptionId: string, offer: OneTimeOffer, regionsVersion?: string): Promise<OneTimeOffer>;
|
|
1265
|
+
updateOffer(packageName: string, productId: string, purchaseOptionId: string, offerId: string, offer: Partial<OneTimeOffer>, updateMask?: string, regionsVersion?: string, options?: MutationOptions): Promise<OneTimeOffer>;
|
|
1266
|
+
deleteOffer(packageName: string, productId: string, purchaseOptionId: string, offerId: string): Promise<void>;
|
|
1229
1267
|
batchGet(packageName: string, productIds: string[]): Promise<OneTimeProduct[]>;
|
|
1230
1268
|
batchUpdate(packageName: string, requests: {
|
|
1231
1269
|
requests: Array<{
|
|
@@ -1237,13 +1275,63 @@ interface PlayApiClient {
|
|
|
1237
1275
|
oneTimeProducts: OneTimeProduct[];
|
|
1238
1276
|
}>;
|
|
1239
1277
|
batchDelete(packageName: string, productIds: string[]): Promise<void>;
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1278
|
+
batchDeletePurchaseOptions(packageName: string, productId: string, requests: Array<{
|
|
1279
|
+
packageName: string;
|
|
1280
|
+
productId: string;
|
|
1281
|
+
purchaseOptionId: string;
|
|
1282
|
+
force?: boolean;
|
|
1283
|
+
latencyTolerance?: string;
|
|
1284
|
+
}>): Promise<void>;
|
|
1285
|
+
batchUpdatePurchaseOptionStates(packageName: string, productId: string, requests: Array<{
|
|
1286
|
+
activatePurchaseOptionRequest?: {
|
|
1287
|
+
packageName: string;
|
|
1288
|
+
productId: string;
|
|
1289
|
+
purchaseOptionId: string;
|
|
1290
|
+
latencyTolerance?: string;
|
|
1291
|
+
};
|
|
1292
|
+
deactivatePurchaseOptionRequest?: {
|
|
1293
|
+
packageName: string;
|
|
1294
|
+
productId: string;
|
|
1295
|
+
purchaseOptionId: string;
|
|
1296
|
+
latencyTolerance?: string;
|
|
1297
|
+
};
|
|
1298
|
+
}>): Promise<{
|
|
1299
|
+
oneTimeProducts: OneTimeProduct[];
|
|
1300
|
+
}>;
|
|
1301
|
+
cancelOffer(packageName: string, productId: string, purchaseOptionId: string, offerId: string, latencyTolerance?: string): Promise<OneTimeOffer>;
|
|
1302
|
+
batchGetOffers(packageName: string, productId: string, purchaseOptionId: string, requests: Array<{
|
|
1303
|
+
packageName: string;
|
|
1304
|
+
productId: string;
|
|
1305
|
+
purchaseOptionId: string;
|
|
1306
|
+
offerId: string;
|
|
1307
|
+
}>): Promise<{
|
|
1308
|
+
oneTimeProductOffers: OneTimeOffer[];
|
|
1309
|
+
}>;
|
|
1310
|
+
batchUpdateOffers(packageName: string, productId: string, purchaseOptionId: string, requests: Array<{
|
|
1311
|
+
oneTimeProductOffer: Partial<OneTimeOffer>;
|
|
1312
|
+
updateMask?: string;
|
|
1313
|
+
regionsVersion?: {
|
|
1314
|
+
version: string;
|
|
1315
|
+
};
|
|
1316
|
+
allowMissing?: boolean;
|
|
1317
|
+
latencyTolerance?: string;
|
|
1318
|
+
}>): Promise<{
|
|
1319
|
+
oneTimeProductOffers: OneTimeOffer[];
|
|
1320
|
+
}>;
|
|
1321
|
+
batchUpdateOfferStates(packageName: string, productId: string, purchaseOptionId: string, requests: Array<{
|
|
1322
|
+
activateOneTimeProductOfferRequest?: Record<string, unknown>;
|
|
1323
|
+
deactivateOneTimeProductOfferRequest?: Record<string, unknown>;
|
|
1324
|
+
cancelOneTimeProductOfferRequest?: Record<string, unknown>;
|
|
1325
|
+
}>): Promise<{
|
|
1326
|
+
oneTimeProductOffers: OneTimeOffer[];
|
|
1327
|
+
}>;
|
|
1328
|
+
batchDeleteOffers(packageName: string, productId: string, purchaseOptionId: string, requests: Array<{
|
|
1329
|
+
packageName: string;
|
|
1330
|
+
productId: string;
|
|
1331
|
+
purchaseOptionId: string;
|
|
1332
|
+
offerId: string;
|
|
1333
|
+
latencyTolerance?: string;
|
|
1334
|
+
}>): Promise<void>;
|
|
1247
1335
|
};
|
|
1248
1336
|
internalAppSharing: {
|
|
1249
1337
|
uploadBundle(packageName: string, bundlePath: string): Promise<InternalAppSharingArtifact>;
|
|
@@ -1253,6 +1341,14 @@ interface PlayApiClient {
|
|
|
1253
1341
|
list(packageName: string, versionCode: number): Promise<GeneratedApk[]>;
|
|
1254
1342
|
download(packageName: string, versionCode: number, id: string): Promise<ArrayBuffer>;
|
|
1255
1343
|
};
|
|
1344
|
+
systemApks: {
|
|
1345
|
+
create(packageName: string, versionCode: number, variant: SystemApkVariant): Promise<SystemApkVariant>;
|
|
1346
|
+
list(packageName: string, versionCode: number): Promise<{
|
|
1347
|
+
variants: SystemApkVariant[];
|
|
1348
|
+
}>;
|
|
1349
|
+
get(packageName: string, versionCode: number, variantId: number): Promise<SystemApkVariant>;
|
|
1350
|
+
download(packageName: string, versionCode: number, variantId: number): Promise<ArrayBuffer>;
|
|
1351
|
+
};
|
|
1256
1352
|
}
|
|
1257
1353
|
declare function createApiClient(options: ApiClientOptions): PlayApiClient;
|
|
1258
1354
|
|
|
@@ -1273,11 +1369,11 @@ interface UsersApiClient {
|
|
|
1273
1369
|
pageToken?: string;
|
|
1274
1370
|
pageSize?: number;
|
|
1275
1371
|
}): Promise<UsersListResponse>;
|
|
1276
|
-
get(developerId: string, userId: string): Promise<User>;
|
|
1277
1372
|
create(developerId: string, user: Partial<User>): Promise<User>;
|
|
1278
1373
|
update(developerId: string, userId: string, user: Partial<User>, updateMask?: string): Promise<User>;
|
|
1279
1374
|
delete(developerId: string, userId: string): Promise<void>;
|
|
1280
1375
|
grants: {
|
|
1376
|
+
/** Not in official API reference but may work as an undocumented endpoint. */
|
|
1281
1377
|
list(developerId: string, email: string): Promise<GrantsListResponse>;
|
|
1282
1378
|
create(developerId: string, email: string, grant: Partial<Grant>): Promise<Grant>;
|
|
1283
1379
|
patch(developerId: string, email: string, packageName: string, grant: Partial<Grant>, updateMask?: string): Promise<Grant>;
|
|
@@ -1429,4 +1525,4 @@ declare class PlayApiError extends Error {
|
|
|
1429
1525
|
/** Files below this threshold use simple upload instead. */
|
|
1430
1526
|
declare const RESUMABLE_THRESHOLD: number;
|
|
1431
1527
|
|
|
1432
|
-
export { type Achievement, type Anomaly, type AnomalyDetectionResponse, type ApiClientOptions, type ApiResponse, type ApkInfo, type ApksListResponse, type AppDetails, type AppEdit, type AppRecoveriesListResponse, type AppRecoveryAction, type AppRecoveryTargeting, type BasePlan, type BasePlanMigratePricesRequest, type BatchGetOrdersResponse, type Bundle, type BundleListResponse, type ChangesInReviewBehavior, type ConvertRegionPricesRequest, type ConvertRegionPricesResponse, type ConvertedRegionPrice, type CountryAvailability, type CreateAppRecoveryActionRequest, type CustomApp, type CustomAppsListResponse, type DataSafety, type DataSafetyDataType, type DataSafetyPurpose, type DeobfuscationFile, type DeobfuscationFileType, type DeobfuscationUploadResponse, type DeveloperComment, type DeveloperPermission, type DeviceGroup, type DeviceSelector, type DeviceTier, type DeviceTierConfig, type DeviceTierConfigsListResponse, type EditCommitOptions, type EnterpriseApiClient, type ErrorIssue, type ErrorIssuesResponse, type ErrorReport, type ErrorReportsResponse, type ExpansionFile, type ExpansionFileType, type ExternalTransaction, type ExternalTransactionAmount, type ExternalTransactionRefund, type ExternallyHostedApk, type ExternallyHostedApkResponse, type GameEvent, type GamesApiClient, type GeneratedApk, type GeneratedApksPerVersion, type Grant, type GrantsListResponse, type HttpClient, type Image, type ImageType, type ImageUploadResponse, type ImagesDeleteAllResponse, type ImagesListResponse, type InAppProduct, type InAppProductListing, type InAppProductsBatchDeleteRequest, type InAppProductsBatchGetRequest, type InAppProductsBatchUpdateRequest, type InAppProductsBatchUpdateResponse, type InAppProductsListResponse, type InternalAppSharingArtifact, type Leaderboard, type LeaderboardScore, type Listing, type ListingsListResponse, type MetricRow, type MetricSetQuery, type MetricSetResponse, type Money, type MutationOptions, type OffersListResponse, type OneTimeOffer, type OneTimeOfferRegionalConfig, type OneTimeOffersListResponse, type OneTimeProduct, type OneTimeProductListing, type OneTimeProductsListResponse, type Order, type OrderLineItem, type PagedResponse, type PaginateOptions, type PlayApiClient, PlayApiError, type ProductPurchase, type ProductPurchaseLineItem, type ProductPurchaseV2, type ProductUpdateLatencyTolerance,
|
|
1528
|
+
export { type Achievement, type Anomaly, type AnomalyDetectionResponse, type ApiClientOptions, type ApiResponse, type ApkInfo, type ApksListResponse, type AppDetails, type AppEdit, type AppRecoveriesListResponse, type AppRecoveryAction, type AppRecoveryTargeting, type BasePlan, type BasePlanMigratePricesRequest, type BatchGetOrdersResponse, type BatchMigratePricesRequest, type BatchMigratePricesResponse, type Bundle, type BundleListResponse, type ChangesInReviewBehavior, type ConvertRegionPricesRequest, type ConvertRegionPricesResponse, type ConvertedRegionPrice, type CountryAvailability, type CreateAppRecoveryActionRequest, type CustomApp, type CustomAppsListResponse, type DataSafety, type DataSafetyDataType, type DataSafetyPurpose, type DeobfuscationFile, type DeobfuscationFileType, type DeobfuscationUploadResponse, type DeveloperComment, type DeveloperPermission, type DeviceGroup, type DeviceSelector, type DeviceTier, type DeviceTierConfig, type DeviceTierConfigsListResponse, type EditCommitOptions, type EnterpriseApiClient, type ErrorIssue, type ErrorIssuesResponse, type ErrorReport, type ErrorReportsResponse, type ExpansionFile, type ExpansionFileType, type ExternalTransaction, type ExternalTransactionAmount, type ExternalTransactionRefund, type ExternallyHostedApk, type ExternallyHostedApkResponse, type GameEvent, type GamesApiClient, type GeneratedApk, type GeneratedApksPerVersion, type Grant, type GrantsListResponse, type HttpClient, type Image, type ImageType, type ImageUploadResponse, type ImagesDeleteAllResponse, type ImagesListResponse, type InAppProduct, type InAppProductListing, type InAppProductsBatchDeleteRequest, type InAppProductsBatchGetRequest, type InAppProductsBatchUpdateRequest, type InAppProductsBatchUpdateResponse, type InAppProductsListResponse, type InternalAppSharingArtifact, type Leaderboard, type LeaderboardScore, type Listing, type ListingsListResponse, type MetricRow, type MetricSetQuery, type MetricSetResponse, type Money, type MutationOptions, type OffersListResponse, type OneTimeOffer, type OneTimeOfferRegionalConfig, type OneTimeOffersListResponse, type OneTimeProduct, type OneTimeProductListing, type OneTimeProductsListResponse, type Order, type OrderLineItem, type PagedResponse, type PaginateOptions, type PlayApiClient, PlayApiError, type ProductPurchase, type ProductPurchaseLineItem, type ProductPurchaseV2, type ProductUpdateLatencyTolerance, RATE_LIMIT_BUCKETS, RESUMABLE_THRESHOLD, type RateLimitBucket, type RateLimiter, type RegionalBasePlanConfig, type Release, type ReleaseNote, type ReleaseStatus, type ReleaseSummary, type ReleasesListResponse, type ReportBucket, type ReportType, type ReportingAggregation, type ReportingApiClient, type ReportingDimension, type ReportsListResponse, type ResumableUploadOptions, type RetryLogEntry, type Review, type ReviewComment, type ReviewReplyRequest, type ReviewReplyResponse, type ReviewsListOptions, type ReviewsListResponse, type StatsDimension, type Subscription, type SubscriptionDeferRequest, type SubscriptionDeferResponse, type SubscriptionListing, type SubscriptionOffer, type SubscriptionOfferPhase, type SubscriptionPurchase, type SubscriptionPurchaseLineItem, type SubscriptionPurchaseV2, type SubscriptionsBatchGetRequest, type SubscriptionsBatchGetResponse, type SubscriptionsBatchUpdateRequest, type SubscriptionsBatchUpdateResponse, type SubscriptionsListResponse, type SubscriptionsV2CancelRequest, type SubscriptionsV2DeferRequest, type SubscriptionsV2DeferResponse, type SystemApkDeviceSpec, type SystemApkOptions, type SystemApkVariant, type TaxAndComplianceSettings, type Testers, type TokenPagination, type Track, type TrackListResponse, type UploadProgressEvent, type UploadResponse, type User, type UserComment, type UsersApiClient, type UsersListResponse, type VitalsMetricSet, type VoidedPurchase, type VoidedPurchasesListResponse, createApiClient, createEnterpriseClient, createGamesClient, createHttpClient, createRateLimiter, createReportingClient, createUsersClient, paginate, paginateAll, paginateParallel, resolveBucket };
|