pabal-store-api-mcp 1.3.15 → 1.3.17

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.
@@ -6,6 +6,29 @@ import { verifyAppStoreAuth } from "../../packages/stores/app-store/verify-auth.
6
6
  import { createAppStoreClient } from "../../core/clients/app-store-factory.js";
7
7
  import { parseAppStoreScreenshots, hasScreenshots, APP_STORE_DEVICE_TYPES, } from "../../core/helpers/screenshot-helpers.js";
8
8
  import { checkPushPrerequisites, serviceFailure, toServiceResult, updateRegisteredLocales, } from "./service-helpers.js";
9
+ const APP_STORE_RELEASE_NOTES_UPDATE_CONCURRENCY = 5;
10
+ const updateReleaseNotesWithConcurrency = async (options) => {
11
+ const { locales, concurrency, update } = options;
12
+ const results = new Array(locales.length);
13
+ let nextIndex = 0;
14
+ const workerCount = Math.min(concurrency, locales.length);
15
+ await Promise.all(Array.from({ length: workerCount }, async () => {
16
+ while (nextIndex < locales.length) {
17
+ const currentIndex = nextIndex;
18
+ nextIndex += 1;
19
+ const locale = locales[currentIndex];
20
+ try {
21
+ await update(locale);
22
+ results[currentIndex] = { locale };
23
+ }
24
+ catch (error) {
25
+ const message = error instanceof Error ? error.message : String(error);
26
+ results[currentIndex] = { locale, error: message };
27
+ }
28
+ }
29
+ }));
30
+ return results;
31
+ };
9
32
  export function resolveAppStoreLocales(allLocales, requestedLocales) {
10
33
  if (!requestedLocales?.length) {
11
34
  return { localesToPush: allLocales, missingLocales: [] };
@@ -111,22 +134,19 @@ export class AppStoreService {
111
134
  const localesToUpdate = supportedLocales
112
135
  ? Object.keys(releaseNotes).filter((locale) => supportedLocales.includes(locale))
113
136
  : Object.keys(releaseNotes);
114
- const updated = [];
115
- const failed = [];
116
- for (const locale of localesToUpdate) {
117
- try {
118
- await client.updateWhatsNew({
119
- versionId: targetVersionId,
120
- locale,
121
- whatsNew: releaseNotes[locale],
122
- });
123
- updated.push(locale);
124
- }
125
- catch (error) {
126
- const msg = error instanceof Error ? error.message : String(error);
127
- failed.push({ locale, error: msg });
128
- }
129
- }
137
+ const updateResults = await updateReleaseNotesWithConcurrency({
138
+ locales: localesToUpdate,
139
+ concurrency: APP_STORE_RELEASE_NOTES_UPDATE_CONCURRENCY,
140
+ update: (locale) => client.updateWhatsNew({
141
+ versionId: targetVersionId,
142
+ locale,
143
+ whatsNew: releaseNotes[locale],
144
+ }),
145
+ });
146
+ const updated = updateResults
147
+ .filter((result) => !result.error)
148
+ .map((result) => result.locale);
149
+ const failed = updateResults.flatMap((result) => result.error ? [{ locale: result.locale, error: result.error }] : []);
130
150
  const success = failed.length === 0;
131
151
  const partialError = !success
132
152
  ? AppError.wrap(failed[0]?.error ?? "Failed to update some release notes", HTTP_STATUS.INTERNAL_SERVER_ERROR, ERROR_CODES.APP_STORE_UPDATE_RELEASE_NOTES_PARTIAL)
@@ -534,7 +534,11 @@ export class GooglePlayClient {
534
534
  auth: session.auth,
535
535
  packageName: session.packageName,
536
536
  editId: session.editId,
537
- });
537
+ },
538
+ // Google Play deletes an edit after a successful commit. Retrying this
539
+ // non-idempotent request can surface a false "This Edit has been deleted"
540
+ // failure when the first attempt actually committed.
541
+ { retry: false });
538
542
  return { data: response.data };
539
543
  }
540
544
  async getAppDetails(session) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pabal-store-api-mcp",
3
- "version": "1.3.15",
3
+ "version": "1.3.17",
4
4
  "description": "MCP server for App Store / Play Store ASO workflows",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",