@bprotsyk/aso-core 2.1.66 → 2.1.68

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/lib/app/app.d.ts CHANGED
@@ -68,6 +68,11 @@ export interface IPlatformParams {
68
68
  appId: number;
69
69
  postApiKey: string;
70
70
  };
71
+ appsflyerParams?: {
72
+ devKey: string;
73
+ appId?: string;
74
+ eventIds?: Record<string, string>;
75
+ };
71
76
  proxied?: boolean;
72
77
  keitaroData?: IAppKeitaroData | boolean;
73
78
  }
@@ -287,16 +287,29 @@ async function cloneDirectCampaign(app, platform) {
287
287
  let allCampaigns = await getAllCampaigns();
288
288
  let matchingCampaign = [];
289
289
  if (platform && platform !== app_1.EPlatform.GENERAL) {
290
- // Шукаємо кампанію з платформою
291
- matchingCampaign = allCampaigns.filter((c) => c.name.includes(`#${app.id}`) &&
292
- c.name.includes(`[➥]`) &&
293
- c.name.includes(`(${platformName})`));
290
+ // Для конкретної платформи
291
+ const platformName = (0, app_1.getPlatformName)(platform);
292
+ matchingCampaign = allCampaigns.filter((c) => {
293
+ // Перевіряємо наявність ID в будь-якому місці
294
+ const hasId = c.name.includes(app.id.toString());
295
+ // Перевіряємо наявність стрілки
296
+ const hasArrow = c.name.includes('➥');
297
+ // Перевіряємо наявність платформи в дужках
298
+ const hasPlatform = c.name.includes(`(${platformName})`);
299
+ return hasId && hasArrow && hasPlatform;
300
+ });
294
301
  }
295
302
  else {
296
- // Шукаємо кампанію без платформи або з суфіксом
297
- matchingCampaign = allCampaigns.filter((c) => c.name.includes(`#${app.id}`) &&
298
- c.name.includes(`[➥]`) &&
299
- !c.name.includes('('));
303
+ // Для General платформи
304
+ matchingCampaign = allCampaigns.filter((c) => {
305
+ // Перевіряємо наявність ID в будь-якому місці
306
+ const hasId = c.name.includes(app.id.toString());
307
+ // Перевіряємо наявність стрілки
308
+ const hasArrow = c.name.includes('➥');
309
+ // Перевіряємо відсутність дужок з платформою
310
+ const hasNoPlatform = !/\([^)]+\)/.test(c.name);
311
+ return hasId && hasArrow && hasNoPlatform;
312
+ });
300
313
  }
301
314
  if (matchingCampaign.length > 0)
302
315
  return matchingCampaign[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "2.1.66",
3
+ "version": "2.1.68",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
package/src/app/app.ts CHANGED
@@ -104,6 +104,11 @@ export interface IPlatformParams {
104
104
  appId: number,
105
105
  postApiKey: string,
106
106
  },
107
+ appsflyerParams? :{
108
+ devKey: string,
109
+ appId?: string,
110
+ eventIds?: Record<string, string>,
111
+ },
107
112
  proxied?: boolean,
108
113
  keitaroData?: IAppKeitaroData | boolean
109
114
  }
@@ -354,23 +354,31 @@ async function cloneDirectCampaign(app: IApp, platform?: EPlatform): Promise<IKe
354
354
  };
355
355
 
356
356
  let allCampaigns = await getAllCampaigns();
357
-
358
357
  let matchingCampaign: IKeitaroCampaign[] = [];
359
358
 
360
359
  if (platform && platform !== EPlatform.GENERAL) {
361
- // Шукаємо кампанію з платформою
362
- matchingCampaign = allCampaigns.filter((c) =>
363
- c.name.includes(`#${app.id}`) &&
364
- c.name.includes(`[➥]`) &&
365
- c.name.includes(`(${platformName})`)
366
- );
360
+ // Для конкретної платформи
361
+ const platformName = getPlatformName(platform);
362
+ matchingCampaign = allCampaigns.filter((c) => {
363
+ // Перевіряємо наявність ID в будь-якому місці
364
+ const hasId = c.name.includes(app.id.toString());
365
+ // Перевіряємо наявність стрілки
366
+ const hasArrow = c.name.includes('➥');
367
+ // Перевіряємо наявність платформи в дужках
368
+ const hasPlatform = c.name.includes(`(${platformName})`);
369
+ return hasId && hasArrow && hasPlatform;
370
+ });
367
371
  } else {
368
- // Шукаємо кампанію без платформи або з суфіксом
369
- matchingCampaign = allCampaigns.filter((c) =>
370
- c.name.includes(`#${app.id}`) &&
371
- c.name.includes(`[➥]`) &&
372
- !c.name.includes('(')
373
- );
372
+ // Для General платформи
373
+ matchingCampaign = allCampaigns.filter((c) => {
374
+ // Перевіряємо наявність ID в будь-якому місці
375
+ const hasId = c.name.includes(app.id.toString());
376
+ // Перевіряємо наявність стрілки
377
+ const hasArrow = c.name.includes('➥');
378
+ // Перевіряємо відсутність дужок з платформою
379
+ const hasNoPlatform = !/\([^)]+\)/.test(c.name);
380
+ return hasId && hasArrow && hasNoPlatform;
381
+ });
374
382
  }
375
383
 
376
384
  if (matchingCampaign.length > 0) return matchingCampaign[0];