@bprotsyk/aso-core 2.1.96 → 2.1.97

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.
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.sendPostbacks = exports.createOWCampaign = exports.createDirectCampaign = exports.prepareOWCampaignParameters = exports.removeGeosFromAllRedirectCampaigns = exports.addGeosToAllRedirectCampaigns = exports.TRAFFIC_SOURCE_ID_FLASH_AI = void 0;
7
7
  const keitaro_service_1 = require("../network/keitaro/keitaro-service");
8
- const sleep = require('sleep-promise');
9
8
  const axios_1 = __importDefault(require("axios"));
10
9
  const keitaro_clicks_1 = require("../keitaro/keitaro-clicks");
11
10
  const FLASH_REDIRECT_GROUP_ID = 82;
@@ -59,6 +58,10 @@ const COST_CURRENCY_USD = "USD";
59
58
  // offerIdParameterName: "i",
60
59
  // }
61
60
  // } as IFlashApp
61
+ function sleep(ms) {
62
+ return new Promise(resolve => setTimeout(resolve, ms));
63
+ }
64
+ ``;
62
65
  let addGeosToAllRedirectCampaigns = async (geosToAdd) => {
63
66
  let allCampaigns = await keitaro_service_1.KeitaroService.getAllCampaigns();
64
67
  let regexp = new RegExp(`^F #`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "2.1.96",
3
+ "version": "2.1.97",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -4,7 +4,6 @@ import { AppType } from "../app/app-type"
4
4
  import { IKeitaroCampaign, IKeitaroCampaignParameters } from "../keitaro/keitaro-campaign"
5
5
  import { IKeitaroDomain } from "../keitaro/keitaro-domain"
6
6
  import { KeitaroService } from "../network/keitaro/keitaro-service"
7
- const sleep = require('sleep-promise');
8
7
  import * as util from 'util';
9
8
  import axios from "axios"
10
9
  import { getTimestampsForTodayAndYesterday } from "../utils/general"
@@ -68,6 +67,10 @@ const COST_CURRENCY_USD = "USD"
68
67
  // }
69
68
  // } as IFlashApp
70
69
 
70
+ function sleep(ms: number): Promise<void> {
71
+ return new Promise(resolve => setTimeout(resolve, ms));
72
+ }``
73
+
71
74
  export let addGeosToAllRedirectCampaigns = async (geosToAdd: string) => {
72
75
  let allCampaigns = await KeitaroService.getAllCampaigns()
73
76
 
@@ -409,8 +412,8 @@ export let prepareOWCampaignParameters = (app: IApp): IKeitaroCampaignParameters
409
412
  "placeholder": "",
410
413
  "alias": "offer_id"
411
414
  },
412
-
413
-
415
+
416
+
414
417
  }
415
418
  }
416
419
 
@@ -477,7 +480,7 @@ export async function createDirectCampaign(app: IApp) {
477
480
  return campaign
478
481
  }
479
482
 
480
- export async function createOWCampaign(app: IApp, platform?: EPlatform ) {
483
+ export async function createOWCampaign(app: IApp, platform?: EPlatform) {
481
484
  let owCampaign = await KeitaroService.cloneOWCampaign(app, platform)
482
485
 
483
486
  return owCampaign
@@ -800,7 +803,7 @@ async function checkMultipleIPs() {
800
803
  try {
801
804
  const clicks = await getClicksByIp(ip, 2832, KeitaroClicksInterval.SEVEN_DAYS_AGO);
802
805
  subids.push(clicks[clicks.length - 1].sub_id)
803
- } catch (error) { }
806
+ } catch (error) { }
804
807
  await sleep(300); // Delay to avoid rate limiting
805
808
  }
806
809