@bprotsyk/aso-core 2.1.117 → 2.1.119

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.
@@ -199,26 +199,28 @@ async function syncKeitaroCLOGeosWithApps(apps) {
199
199
  console.log(` App гео для платформи ${platform}: ${appGeos.join(', ')}`);
200
200
  // Порівнюємо гео
201
201
  const missingGeos = keitaroGeos.filter(geo => !appGeos.includes(geo));
202
- const needsUpdate = missingGeos.length > 0;
203
- console.log(` Відсутні гео: ${missingGeos.join(', ')}`);
202
+ const needsUpdate = missingGeos.length > 0 || appGeos.length !== keitaroGeos.length ||
203
+ !appGeos.every(geo => keitaroGeos.includes(geo));
204
+ console.log(` Відсутні гео в app: ${missingGeos.join(', ')}`);
204
205
  console.log(` Потребує оновлення: ${needsUpdate}`);
205
206
  if (needsUpdate) {
206
207
  summary.appsNeedingUpdate++;
208
+ // Формуємо нові гео - беремо тільки ті, що є в Keitaro
207
209
  const updateData = {
208
210
  appId: parseInt(group),
209
211
  platform: platform,
210
- newGeos: [...appGeos, ...missingGeos]
212
+ newGeos: keitaroGeos // Використовуємо гео з Keitaro як джерело істини
211
213
  };
212
214
  summary.updates.push(updateData);
213
215
  console.log(`✅ Додаток ${group} (${platform}) потребує оновлення гео:`);
214
216
  console.log(` Кампанія: ${campaign.name}`);
215
217
  console.log(` Keitaro гео: ${keitaroGeos.join(', ')}`);
216
218
  console.log(` App гео: ${appGeos.join(', ')}`);
217
- console.log(` Відсутні гео: ${missingGeos.join(', ')}`);
218
- console.log(` Нові гео: ${updateData.newGeos.join(', ')}`);
219
+ console.log(` Відсутні гео в app: ${missingGeos.join(', ')}`);
220
+ console.log(` Нові гео (з Keitaro): ${updateData.newGeos.join(', ')}`);
219
221
  }
220
222
  else {
221
- console.log(`✅ Додаток ${group} (${platform}) не потребує оновлення гео`);
223
+ console.log(`✅ Додаток ${group} (${platform}) не потребує оновлення гео - гео ідентичні`);
222
224
  }
223
225
  }
224
226
  catch (error) {
@@ -269,7 +271,8 @@ async function getAppGeoSyncDetails(appId, platform, apps) {
269
271
  const appGeos = platformData.geo || [];
270
272
  // Порівнюємо гео
271
273
  const missingGeos = keitaroGeos.filter(geo => !appGeos.includes(geo));
272
- const needsUpdate = missingGeos.length > 0;
274
+ const needsUpdate = missingGeos.length > 0 || appGeos.length !== keitaroGeos.length ||
275
+ !appGeos.every(geo => keitaroGeos.includes(geo));
273
276
  return {
274
277
  appId,
275
278
  platform,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "2.1.117",
3
+ "version": "2.1.119",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -252,18 +252,20 @@ export async function syncKeitaroCLOGeosWithApps(apps: IApp[]): Promise<IGeoSync
252
252
 
253
253
  // Порівнюємо гео
254
254
  const missingGeos = keitaroGeos.filter(geo => !appGeos.includes(geo));
255
- const needsUpdate = missingGeos.length > 0;
255
+ const needsUpdate = missingGeos.length > 0 || appGeos.length !== keitaroGeos.length ||
256
+ !appGeos.every(geo => keitaroGeos.includes(geo));
256
257
 
257
- console.log(` Відсутні гео: ${missingGeos.join(', ')}`);
258
+ console.log(` Відсутні гео в app: ${missingGeos.join(', ')}`);
258
259
  console.log(` Потребує оновлення: ${needsUpdate}`);
259
260
 
260
261
  if (needsUpdate) {
261
262
  summary.appsNeedingUpdate++;
262
263
 
264
+ // Формуємо нові гео - беремо тільки ті, що є в Keitaro
263
265
  const updateData: IGeoUpdateData = {
264
266
  appId: parseInt(group),
265
267
  platform: platform,
266
- newGeos: [...appGeos, ...missingGeos]
268
+ newGeos: keitaroGeos // Використовуємо гео з Keitaro як джерело істини
267
269
  };
268
270
 
269
271
  summary.updates.push(updateData);
@@ -272,10 +274,10 @@ export async function syncKeitaroCLOGeosWithApps(apps: IApp[]): Promise<IGeoSync
272
274
  console.log(` Кампанія: ${campaign.name}`);
273
275
  console.log(` Keitaro гео: ${keitaroGeos.join(', ')}`);
274
276
  console.log(` App гео: ${appGeos.join(', ')}`);
275
- console.log(` Відсутні гео: ${missingGeos.join(', ')}`);
276
- console.log(` Нові гео: ${updateData.newGeos.join(', ')}`);
277
+ console.log(` Відсутні гео в app: ${missingGeos.join(', ')}`);
278
+ console.log(` Нові гео (з Keitaro): ${updateData.newGeos.join(', ')}`);
277
279
  } else {
278
- console.log(`✅ Додаток ${group} (${platform}) не потребує оновлення гео`);
280
+ console.log(`✅ Додаток ${group} (${platform}) не потребує оновлення гео - гео ідентичні`);
279
281
  }
280
282
 
281
283
  } catch (error) {
@@ -336,7 +338,8 @@ export async function getAppGeoSyncDetails(appId: number, platform: string, apps
336
338
 
337
339
  // Порівнюємо гео
338
340
  const missingGeos = keitaroGeos.filter(geo => !appGeos.includes(geo));
339
- const needsUpdate = missingGeos.length > 0;
341
+ const needsUpdate = missingGeos.length > 0 || appGeos.length !== keitaroGeos.length ||
342
+ !appGeos.every(geo => keitaroGeos.includes(geo));
340
343
 
341
344
  return {
342
345
  appId,