@gpc-cli/api 1.0.1 → 1.0.2

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/README.md +78 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # @gpc-cli/api
2
+
3
+ Typed client for Google Play Developer API v3. Covers 162 endpoints with built-in rate limiting, retry logic, and pagination.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @gpc-cli/api @gpc-cli/auth
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { createApiClient, createReportingClient } from "@gpc-cli/api";
15
+ import { resolveAuth } from "@gpc-cli/auth";
16
+
17
+ const auth = await resolveAuth({
18
+ serviceAccount: "./service-account.json",
19
+ });
20
+
21
+ const client = createApiClient({ auth });
22
+
23
+ // List apps
24
+ const apps = await client.apps.list();
25
+
26
+ // Get tracks
27
+ const tracks = await client.tracks.list("com.example.app");
28
+
29
+ // Upload a bundle
30
+ const edit = await client.edits.insert("com.example.app");
31
+ const upload = await client.edits.bundles.upload(
32
+ "com.example.app",
33
+ edit.id,
34
+ buffer,
35
+ );
36
+ await client.edits.commit("com.example.app", edit.id);
37
+ ```
38
+
39
+ ## Clients
40
+
41
+ | Factory | Base URL | Purpose |
42
+ |---------|----------|---------|
43
+ | `createApiClient()` | `androidpublisher.googleapis.com` | Core Play API (apps, releases, listings, monetization) |
44
+ | `createReportingClient()` | `playdeveloperreporting.googleapis.com` | Vitals, crashes, ANR, errors |
45
+ | `createUsersClient()` | `androidpublisher.googleapis.com` | Developer account users and grants |
46
+ | `createHttpClient()` | Custom | Low-level HTTP with auth, retry, rate limiting |
47
+
48
+ ## Features
49
+
50
+ - **Rate limiting** — per-bucket token bucket respecting Google's quota buckets
51
+ - **Retry logic** — exponential backoff with jitter on 429/5xx
52
+ - **Pagination** — `paginate()` and `paginateAll()` helpers for auto-following `nextPageToken`
53
+ - **Edit lifecycle** — insert, modify, validate, commit/delete
54
+ - **80+ TypeScript types** — fully typed requests and responses
55
+
56
+ ## Types
57
+
58
+ All Google Play API types are exported:
59
+
60
+ ```typescript
61
+ import type {
62
+ Track,
63
+ Release,
64
+ Listing,
65
+ Subscription,
66
+ InAppProduct,
67
+ Review,
68
+ AppDetails,
69
+ } from "@gpc-cli/api";
70
+ ```
71
+
72
+ ## Part of the GPC Monorepo
73
+
74
+ This is the API layer for [GPC](https://github.com/yasserstudio/gpc). Use it standalone in your own tools, or use the full CLI.
75
+
76
+ ## License
77
+
78
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpc-cli/api",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Typed client for Google Play Developer API v3",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,7 +15,7 @@
15
15
  "dist"
16
16
  ],
17
17
  "peerDependencies": {
18
- "@gpc-cli/auth": "0.1.1"
18
+ "@gpc-cli/auth": "0.1.2"
19
19
  },
20
20
  "keywords": [
21
21
  "google-play",