@bprotsyk/aso-core 2.1.128 → 2.1.129

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.
@@ -16,14 +16,6 @@ export interface IGeoSyncSummary {
16
16
  totalApps: number;
17
17
  appsNeedingUpdate: number;
18
18
  updates: IGeoUpdateData[];
19
- appsNeedingEnable: number;
20
- appsNeedingDisable: number;
21
- enablementChecks: {
22
- appId: number;
23
- platform: string;
24
- mustBeEnabled: boolean;
25
- mustBeDisabled: boolean;
26
- }[];
27
19
  errors: string[];
28
20
  }
29
21
  /**
@@ -119,9 +119,6 @@ async function syncKeitaroCLOGeosWithApps(apps) {
119
119
  totalApps: apps.length,
120
120
  appsNeedingUpdate: 0,
121
121
  updates: [],
122
- appsNeedingEnable: 0,
123
- appsNeedingDisable: 0,
124
- enablementChecks: [],
125
122
  errors: []
126
123
  };
127
124
  try {
@@ -200,32 +197,6 @@ async function syncKeitaroCLOGeosWithApps(apps) {
200
197
  const platformData = app.platforms[platform];
201
198
  const appGeos = platformData?.geo || [];
202
199
  console.log(` App гео для платформи ${platform}: ${appGeos.join(', ')}`);
203
- // Перевіряємо статус CLO потоку в Keitaro
204
- const streams = await getStreamsByCampaignId(campaign.id);
205
- const cloStream = streams.find(stream => stream.name === "CLO");
206
- const keitaroCLOEnabled = cloStream?.state === 'active' || false;
207
- console.log(` CLO потік в Keitaro: ${keitaroCLOEnabled ? 'включений' : 'вимкнений'}`);
208
- // Перевіряємо чи включена платформа в додатку
209
- const appPlatformEnabled = platformData?.enabled || false;
210
- console.log(` Платформа ${platform} в додатку: ${appPlatformEnabled ? 'включена' : 'вимкнена'}`);
211
- // Визначаємо чи потрібно включити/вимкнути додаток
212
- const mustBeEnabled = keitaroCLOEnabled && !appPlatformEnabled;
213
- const mustBeDisabled = !keitaroCLOEnabled && appPlatformEnabled;
214
- if (mustBeEnabled) {
215
- summary.appsNeedingEnable++;
216
- console.log(` ✅ Потребує включення`);
217
- }
218
- else if (mustBeDisabled) {
219
- summary.appsNeedingDisable++;
220
- console.log(` ❌ Потребує вимкнення`);
221
- }
222
- // Додаємо до перевірок включення
223
- summary.enablementChecks.push({
224
- appId: parseInt(group),
225
- platform: platform,
226
- mustBeEnabled: mustBeEnabled,
227
- mustBeDisabled: mustBeDisabled
228
- });
229
200
  // Порівнюємо гео
230
201
  const missingGeos = keitaroGeos.filter(geo => !appGeos.includes(geo));
231
202
  const needsUpdate = missingGeos.length > 0 || appGeos.length !== keitaroGeos.length ||
@@ -258,7 +229,7 @@ async function syncKeitaroCLOGeosWithApps(apps) {
258
229
  summary.errors.push(errorMsg);
259
230
  }
260
231
  }
261
- console.log(`\nСинхронізація завершена. ${summary.appsNeedingUpdate} додатків потребують оновлення гео, ${summary.appsNeedingEnable} потребують включення, ${summary.appsNeedingDisable} потребують вимкнення.`);
232
+ console.log(`\nСинхронізація завершена. ${summary.appsNeedingUpdate} додатків потребують оновлення гео.`);
262
233
  }
263
234
  catch (error) {
264
235
  const errorMsg = `Критична помилка синхронізації: ${error}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "2.1.128",
3
+ "version": "2.1.129",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -25,14 +25,6 @@ export interface IGeoSyncSummary {
25
25
  totalApps: number;
26
26
  appsNeedingUpdate: number;
27
27
  updates: IGeoUpdateData[];
28
- appsNeedingEnable: number;
29
- appsNeedingDisable: number;
30
- enablementChecks: {
31
- appId: number;
32
- platform: string;
33
- mustBeEnabled: boolean;
34
- mustBeDisabled: boolean;
35
- }[];
36
28
  errors: string[];
37
29
  }
38
30
 
@@ -155,9 +147,6 @@ export async function syncKeitaroCLOGeosWithApps(apps: IApp[]): Promise<IGeoSync
155
147
  totalApps: apps.length,
156
148
  appsNeedingUpdate: 0,
157
149
  updates: [],
158
- appsNeedingEnable: 0,
159
- appsNeedingDisable: 0,
160
- enablementChecks: [],
161
150
  errors: []
162
151
  };
163
152
 
@@ -262,36 +251,6 @@ export async function syncKeitaroCLOGeosWithApps(apps: IApp[]): Promise<IGeoSync
262
251
  const appGeos = platformData?.geo || [];
263
252
  console.log(` App гео для платформи ${platform}: ${appGeos.join(', ')}`);
264
253
 
265
- // Перевіряємо статус CLO потоку в Keitaro
266
- const streams = await getStreamsByCampaignId(campaign.id);
267
- const cloStream = streams.find(stream => stream.name === "CLO");
268
- const keitaroCLOEnabled = cloStream?.state === 'active' || false;
269
- console.log(` CLO потік в Keitaro: ${keitaroCLOEnabled ? 'включений' : 'вимкнений'}`);
270
-
271
- // Перевіряємо чи включена платформа в додатку
272
- const appPlatformEnabled = platformData?.enabled || false;
273
- console.log(` Платформа ${platform} в додатку: ${appPlatformEnabled ? 'включена' : 'вимкнена'}`);
274
-
275
- // Визначаємо чи потрібно включити/вимкнути додаток
276
- const mustBeEnabled = keitaroCLOEnabled && !appPlatformEnabled;
277
- const mustBeDisabled = !keitaroCLOEnabled && appPlatformEnabled;
278
-
279
- if (mustBeEnabled) {
280
- summary.appsNeedingEnable++;
281
- console.log(` ✅ Потребує включення`);
282
- } else if (mustBeDisabled) {
283
- summary.appsNeedingDisable++;
284
- console.log(` ❌ Потребує вимкнення`);
285
- }
286
-
287
- // Додаємо до перевірок включення
288
- summary.enablementChecks.push({
289
- appId: parseInt(group),
290
- platform: platform,
291
- mustBeEnabled: mustBeEnabled,
292
- mustBeDisabled: mustBeDisabled
293
- });
294
-
295
254
  // Порівнюємо гео
296
255
  const missingGeos = keitaroGeos.filter(geo => !appGeos.includes(geo));
297
256
  const needsUpdate = missingGeos.length > 0 || appGeos.length !== keitaroGeos.length ||
@@ -329,7 +288,7 @@ export async function syncKeitaroCLOGeosWithApps(apps: IApp[]): Promise<IGeoSync
329
288
  }
330
289
  }
331
290
 
332
- console.log(`\nСинхронізація завершена. ${summary.appsNeedingUpdate} додатків потребують оновлення гео, ${summary.appsNeedingEnable} потребують включення, ${summary.appsNeedingDisable} потребують вимкнення.`);
291
+ console.log(`\nСинхронізація завершена. ${summary.appsNeedingUpdate} додатків потребують оновлення гео.`);
333
292
 
334
293
  } catch (error) {
335
294
  const errorMsg = `Критична помилка синхронізації: ${error}`;