@bprotsyk/aso-core 1.2.193 → 1.2.195
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/flash/flash-app.d.ts +2 -2
- package/lib/flash/flash-app.js +3 -3
- package/lib/network/keitaro/keitaro-service.d.ts +4 -0
- package/lib/network/keitaro/keitaro-service.js +24 -1
- package/lib/panel/flash/upsert-flash-app-request.d.ts +5 -5
- package/lib/utils/general.d.ts +11 -0
- package/lib/utils/general.js +43 -0
- package/lib/utils/keitaro-utils.js +15 -3
- package/package.json +1 -1
- package/src/flash/flash-app.ts +3 -3
- package/src/network/keitaro/keitaro-service.ts +30 -2
- package/src/panel/flash/upsert-flash-app-request.ts +5 -5
- package/src/utils/general.ts +44 -0
- package/src/utils/keitaro-utils.ts +18 -8
package/lib/flash/flash-app.d.ts
CHANGED
|
@@ -124,8 +124,6 @@ export declare const FlashAppSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
124
124
|
bundle: string;
|
|
125
125
|
trackingUrl: string;
|
|
126
126
|
geos: string;
|
|
127
|
-
onesignalAppId: string;
|
|
128
|
-
onesignalRestApiKey: string;
|
|
129
127
|
integrationVersion: string;
|
|
130
128
|
name?: string | undefined;
|
|
131
129
|
webInterfaceName?: string | undefined;
|
|
@@ -138,6 +136,8 @@ export declare const FlashAppSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
138
136
|
bannerParams?: any;
|
|
139
137
|
directParams?: any;
|
|
140
138
|
policyUrl?: string | undefined;
|
|
139
|
+
onesignalAppId?: string | undefined;
|
|
140
|
+
onesignalRestApiKey?: string | undefined;
|
|
141
141
|
linkPath?: string | undefined;
|
|
142
142
|
generationOptions?: {
|
|
143
143
|
splashName?: string | undefined;
|
package/lib/flash/flash-app.js
CHANGED
|
@@ -59,18 +59,18 @@ exports.FlashAppSchema = new mongoose_1.Schema({
|
|
|
59
59
|
},
|
|
60
60
|
onesignalAppId: {
|
|
61
61
|
type: String,
|
|
62
|
-
required:
|
|
62
|
+
required: false
|
|
63
63
|
},
|
|
64
64
|
onesignalRestApiKey: {
|
|
65
65
|
type: String,
|
|
66
|
-
required:
|
|
66
|
+
required: false
|
|
67
67
|
},
|
|
68
68
|
linkPath: {
|
|
69
69
|
type: String
|
|
70
70
|
},
|
|
71
71
|
integrationVersion: {
|
|
72
72
|
type: String,
|
|
73
|
-
default: IntegrationVersion.
|
|
73
|
+
default: IntegrationVersion.OFFER_STUB,
|
|
74
74
|
enum: IntegrationVersion
|
|
75
75
|
},
|
|
76
76
|
integrationAlterations: Object,
|
|
@@ -17,6 +17,8 @@ export declare function upsertStreamToCampaign(campaign: IKeitaroCampaign, strea
|
|
|
17
17
|
declare function cloneOWCampaign(app: IFlashApp): Promise<IKeitaroCampaign>;
|
|
18
18
|
declare function changeCampaignsGroup(fromId: number, toId: number, exceptForCampaignIds: number[]): Promise<void>;
|
|
19
19
|
declare function getDomains(onlyActive?: boolean): Promise<IKeitaroDomain[]>;
|
|
20
|
+
declare function getProfitForTimeRange(from: number, to: number): Promise<number>;
|
|
21
|
+
declare function getProfitForTodayAndYesterday(): Promise<any>;
|
|
20
22
|
export declare const KeitaroService: {
|
|
21
23
|
getStreamsByCampaignId: typeof getStreamsByCampaignId;
|
|
22
24
|
updateCampaign: typeof updateCampaign;
|
|
@@ -32,5 +34,7 @@ export declare const KeitaroService: {
|
|
|
32
34
|
cloneOWCampaign: typeof cloneOWCampaign;
|
|
33
35
|
updateOffer: typeof updateOffer;
|
|
34
36
|
changeCampaignsGroup: typeof changeCampaignsGroup;
|
|
37
|
+
getProfitForTimeRange: typeof getProfitForTimeRange;
|
|
38
|
+
getProfitForTodayAndYesterday: typeof getProfitForTodayAndYesterday;
|
|
35
39
|
};
|
|
36
40
|
export {};
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.KeitaroService = exports.upsertStreamToCampaign = void 0;
|
|
7
7
|
const http_1 = __importDefault(require("./http"));
|
|
8
8
|
const keitaro_utils_1 = require("../../utils/keitaro-utils");
|
|
9
|
+
const general_1 = require("../../utils/general");
|
|
9
10
|
async function getStreamsByCampaignId(campaignId) {
|
|
10
11
|
const { data: streams } = await http_1.default.get(`campaigns/${campaignId}/streams`);
|
|
11
12
|
return streams;
|
|
@@ -197,7 +198,29 @@ async function getDomains(onlyActive) {
|
|
|
197
198
|
const { data: domains } = await http_1.default.get(`/domains`);
|
|
198
199
|
return onlyActive ? domains.filter((d) => d.network_status == "active") : domains;
|
|
199
200
|
}
|
|
201
|
+
async function getProfitForTimeRange(from, to) {
|
|
202
|
+
let fromString = (0, general_1.convertMillisToDate)(from);
|
|
203
|
+
let toString = (0, general_1.convertMillisToDate)(to);
|
|
204
|
+
let { data: data } = await http_1.default.post(`/report/build`, {
|
|
205
|
+
range: {
|
|
206
|
+
from: fromString,
|
|
207
|
+
to: toString,
|
|
208
|
+
timezone: 'Europe/Madrid'
|
|
209
|
+
},
|
|
210
|
+
metrics: ['profit']
|
|
211
|
+
});
|
|
212
|
+
return data.rows[0].profit;
|
|
213
|
+
}
|
|
214
|
+
async function getProfitForTodayAndYesterday() {
|
|
215
|
+
let timestamps = (0, general_1.getTimestampsForTodayAndYesterday)();
|
|
216
|
+
let today = await exports.KeitaroService.getProfitForTimeRange(timestamps.today.start, timestamps.today.end);
|
|
217
|
+
let yeterday = await exports.KeitaroService.getProfitForTimeRange(timestamps.yesterday.start, timestamps.yesterday.end);
|
|
218
|
+
return {
|
|
219
|
+
today: today,
|
|
220
|
+
yesterday: yeterday
|
|
221
|
+
};
|
|
222
|
+
}
|
|
200
223
|
exports.KeitaroService = {
|
|
201
224
|
getStreamsByCampaignId, updateCampaign, getAllCampaigns, getAllOffers, cloneStreams, addOfferToKeitaro, getOfferByKeitaroId, getDomains, createCampaign, getCampaignById, upsertStreamToCampaign, cloneOWCampaign,
|
|
202
|
-
updateOffer, changeCampaignsGroup
|
|
225
|
+
updateOffer, changeCampaignsGroup, getProfitForTimeRange, getProfitForTodayAndYesterday
|
|
203
226
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IAppGenerationOptions, IAppKeitaroData, IBannerParams, IDeveloperParams, IDirectParams, IDomainParams, IOffersStubParams, IPrivacyPolicyParams, IRemoveDataParams, IntegrationVersion } from "flash/flash-app";
|
|
2
2
|
export interface IUpsertFlashAppRequest {
|
|
3
3
|
id: number;
|
|
4
|
-
name
|
|
5
|
-
bundle
|
|
4
|
+
name?: string;
|
|
5
|
+
bundle?: string;
|
|
6
6
|
sourceUrl?: string;
|
|
7
|
-
enabled
|
|
8
|
-
geos
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
geos?: string;
|
|
9
9
|
policyUrl?: string;
|
|
10
|
-
integrationVersion
|
|
10
|
+
integrationVersion?: IntegrationVersion;
|
|
11
11
|
webInterfaceName?: string;
|
|
12
12
|
generationOptions?: Partial<IAppGenerationOptions>;
|
|
13
13
|
keitaroData?: Partial<IAppKeitaroData>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTimestampsForTodayAndYesterday = exports.convertMillisToDate = void 0;
|
|
4
|
+
function convertMillisToDate(millis) {
|
|
5
|
+
const date = new Date(millis);
|
|
6
|
+
const year = date.getFullYear();
|
|
7
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
8
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
9
|
+
return `${year}-${month}-${day}`;
|
|
10
|
+
}
|
|
11
|
+
exports.convertMillisToDate = convertMillisToDate;
|
|
12
|
+
function getTimestampsForTodayAndYesterday() {
|
|
13
|
+
const now = new Date();
|
|
14
|
+
// Today's Start (00:00:00)
|
|
15
|
+
const todayStart = new Date(now);
|
|
16
|
+
todayStart.setHours(0, 0, 0, 0);
|
|
17
|
+
const todayStartTimestamp = todayStart.getTime();
|
|
18
|
+
// Today's End (23:59:59.999)
|
|
19
|
+
const todayEnd = new Date(now);
|
|
20
|
+
todayEnd.setHours(23, 59, 59, 999);
|
|
21
|
+
const todayEndTimestamp = todayEnd.getTime();
|
|
22
|
+
// Yesterday's Start (00:00:00)
|
|
23
|
+
const yesterdayStart = new Date(now);
|
|
24
|
+
yesterdayStart.setDate(now.getDate() - 1);
|
|
25
|
+
yesterdayStart.setHours(0, 0, 0, 0);
|
|
26
|
+
const yesterdayStartTimestamp = yesterdayStart.getTime();
|
|
27
|
+
// Yesterday's End (23:59:59.999)
|
|
28
|
+
const yesterdayEnd = new Date(now);
|
|
29
|
+
yesterdayEnd.setDate(now.getDate() - 1);
|
|
30
|
+
yesterdayEnd.setHours(23, 59, 59, 999);
|
|
31
|
+
const yesterdayEndTimestamp = yesterdayEnd.getTime();
|
|
32
|
+
return {
|
|
33
|
+
today: {
|
|
34
|
+
start: todayStartTimestamp,
|
|
35
|
+
end: todayEndTimestamp,
|
|
36
|
+
},
|
|
37
|
+
yesterday: {
|
|
38
|
+
start: yesterdayStartTimestamp,
|
|
39
|
+
end: yesterdayEndTimestamp,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
exports.getTimestampsForTodayAndYesterday = getTimestampsForTodayAndYesterday;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.createOWCampaign = exports.createFlashCampaigns = exports.createOWStreamPartialPayload = exports.prepareOWCampaignParameters = exports.createOrFindFlashRedirectCampaign = exports.removeGeosFromAllRedirectCampaigns = exports.addGeosToAllRedirectCampaigns = exports.TRAFFIC_SOURCE_ID_FLASH_AI = void 0;
|
|
7
7
|
const keitaro_service_1 = require("../network/keitaro/keitaro-service");
|
|
8
8
|
const sleep_promise_1 = __importDefault(require("sleep-promise"));
|
|
9
|
+
const general_1 = require("../utils/general");
|
|
9
10
|
const FLASH_REDIRECT_GROUP_ID = 82;
|
|
10
11
|
exports.TRAFFIC_SOURCE_ID_FLASH_AI = 22;
|
|
11
12
|
const UNIQUENESS_METHOD = "ip_ua";
|
|
@@ -358,12 +359,12 @@ let changeSourceForFA = async () => {
|
|
|
358
359
|
});
|
|
359
360
|
}
|
|
360
361
|
};
|
|
361
|
-
let
|
|
362
|
+
let replaceInOfferLink = async (old, replace, offerNameRegEx) => {
|
|
362
363
|
let offers = await keitaro_service_1.KeitaroService.getAllOffers();
|
|
363
364
|
offers = offers.filter((o) => offerNameRegEx.exec(o.name));
|
|
364
365
|
for (let offer of offers) {
|
|
365
366
|
console.log(offer.name);
|
|
366
|
-
offer.action_payload = offer.action_payload.replace(
|
|
367
|
+
offer.action_payload = offer.action_payload.replace(old, replace);
|
|
367
368
|
await (0, sleep_promise_1.default)(700);
|
|
368
369
|
await keitaro_service_1.KeitaroService.updateOffer(offer);
|
|
369
370
|
}
|
|
@@ -488,4 +489,15 @@ let moveCampaignsToAnotherGroup = async () => {
|
|
|
488
489
|
// addGeosToAllRedirectCam`paigns("GR")
|
|
489
490
|
// removeGeosFromAllRedirectCampaigns("BE`")
|
|
490
491
|
// gatherInfoForFlashApps()
|
|
491
|
-
//
|
|
492
|
+
// replaceInOfferLink(`xmariorel.com`, `lalielynaualish.com`, /.*icecasino_huffson.*/g)
|
|
493
|
+
// replaceInOfferLink(`lp=18`, `lp=00`, /.*icecasino_huffson.*/g)
|
|
494
|
+
(async () => {
|
|
495
|
+
try {
|
|
496
|
+
let timestamps = (0, general_1.getTimestampsForTodayAndYesterday)();
|
|
497
|
+
let response = await keitaro_service_1.KeitaroService.getProfitForTimeRange(timestamps.today.start, timestamps.today.end);
|
|
498
|
+
console.log(response);
|
|
499
|
+
}
|
|
500
|
+
catch (e) {
|
|
501
|
+
console.log(e);
|
|
502
|
+
}
|
|
503
|
+
})();
|
package/package.json
CHANGED
package/src/flash/flash-app.ts
CHANGED
|
@@ -184,11 +184,11 @@ export const FlashAppSchema = new Schema({
|
|
|
184
184
|
|
|
185
185
|
onesignalAppId: {
|
|
186
186
|
type: String,
|
|
187
|
-
required:
|
|
187
|
+
required: false
|
|
188
188
|
},
|
|
189
189
|
onesignalRestApiKey: {
|
|
190
190
|
type: String,
|
|
191
|
-
required:
|
|
191
|
+
required: false
|
|
192
192
|
},
|
|
193
193
|
|
|
194
194
|
linkPath: {
|
|
@@ -197,7 +197,7 @@ export const FlashAppSchema = new Schema({
|
|
|
197
197
|
|
|
198
198
|
integrationVersion: {
|
|
199
199
|
type: String,
|
|
200
|
-
default: IntegrationVersion.
|
|
200
|
+
default: IntegrationVersion.OFFER_STUB,
|
|
201
201
|
enum: IntegrationVersion
|
|
202
202
|
},
|
|
203
203
|
integrationAlterations: Object,
|
|
@@ -5,6 +5,7 @@ import { IKeitaroCampaign } from "../../keitaro/keitaro-campaign";
|
|
|
5
5
|
import { IKeitaroDomain } from "../../keitaro/keitaro-domain";
|
|
6
6
|
import { IFlashApp } from "../../flash/flash-app";
|
|
7
7
|
import { TRAFFIC_SOURCE_ID_FLASH_AI, prepareOWCampaignParameters } from "../../utils/keitaro-utils";
|
|
8
|
+
import { convertMillisToDate, getTimestampsForTodayAndYesterday } from "../../utils/general";
|
|
8
9
|
|
|
9
10
|
async function getStreamsByCampaignId(campaignId: number): Promise<IKeitaroStream[]> {
|
|
10
11
|
const { data: streams } = await keitaroApi.get<IKeitaroStream[]>(`campaigns/${campaignId}/streams`);
|
|
@@ -130,7 +131,7 @@ function createStreamPartialPayload(keitaroOfferId: number, offerName: string, o
|
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
|
|
133
|
-
async function addOfferToKeitaro(offer: IOffer, affiliateId: number, link: string,campaignGroupId?: number, groupId?: number) {
|
|
134
|
+
async function addOfferToKeitaro(offer: IOffer, affiliateId: number, link: string, campaignGroupId?: number, groupId?: number) {
|
|
134
135
|
// TODO look if offer already exists by offer.name
|
|
135
136
|
let allOffers = await getAllOffers()
|
|
136
137
|
let identicalOffer = allOffers.find((o) => { return o.name.includes(offer.name) })
|
|
@@ -238,7 +239,34 @@ async function getDomains(onlyActive?: boolean): Promise<IKeitaroDomain[]> {
|
|
|
238
239
|
return onlyActive ? domains.filter((d) => d.network_status == "active") : domains
|
|
239
240
|
}
|
|
240
241
|
|
|
242
|
+
async function getProfitForTimeRange(from: number, to: number): Promise<number> {
|
|
243
|
+
let fromString = convertMillisToDate(from)
|
|
244
|
+
let toString = convertMillisToDate(to)
|
|
245
|
+
|
|
246
|
+
let { data: data } = await keitaroApi.post(`/report/build`, {
|
|
247
|
+
range: {
|
|
248
|
+
from: fromString,
|
|
249
|
+
to: toString,
|
|
250
|
+
timezone: 'Europe/Madrid'
|
|
251
|
+
},
|
|
252
|
+
metrics: ['profit']
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
return data.rows[0].profit
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
async function getProfitForTodayAndYesterday(): Promise<any> {
|
|
259
|
+
let timestamps = getTimestampsForTodayAndYesterday()
|
|
260
|
+
let today = await KeitaroService.getProfitForTimeRange(timestamps.today.start, timestamps.today.end)
|
|
261
|
+
let yeterday = await KeitaroService.getProfitForTimeRange(timestamps.yesterday.start, timestamps.yesterday.end)
|
|
262
|
+
|
|
263
|
+
return {
|
|
264
|
+
today: today,
|
|
265
|
+
yesterday: yeterday
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
241
269
|
export const KeitaroService = {
|
|
242
270
|
getStreamsByCampaignId, updateCampaign, getAllCampaigns, getAllOffers, cloneStreams, addOfferToKeitaro, getOfferByKeitaroId, getDomains, createCampaign, getCampaignById, upsertStreamToCampaign, cloneOWCampaign,
|
|
243
|
-
updateOffer, changeCampaignsGroup
|
|
271
|
+
updateOffer, changeCampaignsGroup, getProfitForTimeRange, getProfitForTodayAndYesterday
|
|
244
272
|
}
|
|
@@ -3,18 +3,18 @@ import { PlugType } from "index"
|
|
|
3
3
|
|
|
4
4
|
export interface IUpsertFlashAppRequest {
|
|
5
5
|
id: number
|
|
6
|
-
name
|
|
7
|
-
bundle
|
|
6
|
+
name?: string
|
|
7
|
+
bundle?: string
|
|
8
8
|
sourceUrl?: string,
|
|
9
|
-
enabled
|
|
10
|
-
geos
|
|
9
|
+
enabled?: boolean,
|
|
10
|
+
geos?: string,
|
|
11
11
|
|
|
12
12
|
// onesignalAppId: string
|
|
13
13
|
// onesignalRestApiKey: string
|
|
14
14
|
|
|
15
15
|
policyUrl?: string,
|
|
16
16
|
|
|
17
|
-
integrationVersion
|
|
17
|
+
integrationVersion?: IntegrationVersion,
|
|
18
18
|
|
|
19
19
|
webInterfaceName?: string,
|
|
20
20
|
generationOptions?: Partial<IAppGenerationOptions>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export function convertMillisToDate(millis: number): string {
|
|
2
|
+
const date = new Date(millis);
|
|
3
|
+
const year = date.getFullYear();
|
|
4
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
5
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
6
|
+
return `${year}-${month}-${day}`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function getTimestampsForTodayAndYesterday() {
|
|
10
|
+
const now = new Date();
|
|
11
|
+
|
|
12
|
+
// Today's Start (00:00:00)
|
|
13
|
+
const todayStart = new Date(now);
|
|
14
|
+
todayStart.setHours(0, 0, 0, 0);
|
|
15
|
+
const todayStartTimestamp = todayStart.getTime();
|
|
16
|
+
|
|
17
|
+
// Today's End (23:59:59.999)
|
|
18
|
+
const todayEnd = new Date(now);
|
|
19
|
+
todayEnd.setHours(23, 59, 59, 999);
|
|
20
|
+
const todayEndTimestamp = todayEnd.getTime();
|
|
21
|
+
|
|
22
|
+
// Yesterday's Start (00:00:00)
|
|
23
|
+
const yesterdayStart = new Date(now);
|
|
24
|
+
yesterdayStart.setDate(now.getDate() - 1);
|
|
25
|
+
yesterdayStart.setHours(0, 0, 0, 0);
|
|
26
|
+
const yesterdayStartTimestamp = yesterdayStart.getTime();
|
|
27
|
+
|
|
28
|
+
// Yesterday's End (23:59:59.999)
|
|
29
|
+
const yesterdayEnd = new Date(now);
|
|
30
|
+
yesterdayEnd.setDate(now.getDate() - 1);
|
|
31
|
+
yesterdayEnd.setHours(23, 59, 59, 999);
|
|
32
|
+
const yesterdayEndTimestamp = yesterdayEnd.getTime();
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
today: {
|
|
36
|
+
start: todayStartTimestamp,
|
|
37
|
+
end: todayEndTimestamp,
|
|
38
|
+
},
|
|
39
|
+
yesterday: {
|
|
40
|
+
start: yesterdayStartTimestamp,
|
|
41
|
+
end: yesterdayEndTimestamp,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IKeitaroStream } from "../keitaro/keitaro-stream"
|
|
2
|
-
import {
|
|
2
|
+
import { IFlashApp, PlugType, } from "../flash/flash-app"
|
|
3
3
|
import { FlashAppType } from "../flash/flash-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
7
|
import sleep from 'sleep-promise';
|
|
8
8
|
import * as util from 'util';
|
|
9
|
-
import { PasteMap, TrackingMap } from "utils/app-gathering-utils"
|
|
10
9
|
import axios from "axios"
|
|
10
|
+
import { getTimestampsForTodayAndYesterday } from "../utils/general"
|
|
11
11
|
|
|
12
12
|
const FLASH_REDIRECT_GROUP_ID = 82
|
|
13
13
|
export const TRAFFIC_SOURCE_ID_FLASH_AI = 22
|
|
@@ -394,14 +394,14 @@ let changeSourceForFA = async () => {
|
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
let
|
|
397
|
+
let replaceInOfferLink = async (old: string, replace: string, offerNameRegEx: RegExp) => {
|
|
398
398
|
let offers = await KeitaroService.getAllOffers()
|
|
399
399
|
|
|
400
400
|
offers = offers.filter((o) => offerNameRegEx.exec(o.name))
|
|
401
401
|
|
|
402
402
|
for (let offer of offers) {
|
|
403
403
|
console.log(offer.name)
|
|
404
|
-
offer.action_payload = offer.action_payload.replace(
|
|
404
|
+
offer.action_payload = offer.action_payload.replace(old, replace)
|
|
405
405
|
|
|
406
406
|
await sleep(700)
|
|
407
407
|
await KeitaroService.updateOffer(offer)
|
|
@@ -530,14 +530,14 @@ let findBrokenOfferStreams = async () => {
|
|
|
530
530
|
console.log(`${stream.name}: id payload is missing, payload: ${stream.filters}`)
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
}
|
|
533
|
+
}
|
|
534
534
|
}
|
|
535
535
|
|
|
536
536
|
let moveCampaignsToAnotherGroup = async () => {
|
|
537
537
|
let from = 2, to = 80, exceptFor = [2684, 2686, 2673, 2670, 2687, 2689, 2529, 2688, 2551, 2517, 2691, 2588, 2643, 2563, 2598, 2624, 2584, 2553, 2683, 2618, 2499, 2594, 2545, 2682, 2569, 2527, 2681, 2677, 2610, 2608]
|
|
538
|
-
|
|
538
|
+
|
|
539
539
|
await KeitaroService.changeCampaignsGroup(from, to, exceptFor)
|
|
540
|
-
}
|
|
540
|
+
}
|
|
541
541
|
|
|
542
542
|
// moveCampaignsToAnotherGroup()
|
|
543
543
|
|
|
@@ -561,5 +561,15 @@ let moveCampaignsToAnotherGroup = async () => {
|
|
|
561
561
|
|
|
562
562
|
// gatherInfoForFlashApps()
|
|
563
563
|
|
|
564
|
-
//
|
|
564
|
+
// replaceInOfferLink(`xmariorel.com`, `lalielynaualish.com`, /.*icecasino_huffson.*/g)
|
|
565
|
+
// replaceInOfferLink(`lp=18`, `lp=00`, /.*icecasino_huffson.*/g)
|
|
565
566
|
|
|
567
|
+
(async () => {
|
|
568
|
+
try {
|
|
569
|
+
let timestamps = getTimestampsForTodayAndYesterday()
|
|
570
|
+
let response = await KeitaroService.getProfitForTimeRange(timestamps.today.start, timestamps.today.end)
|
|
571
|
+
console.log(response)
|
|
572
|
+
} catch (e) {
|
|
573
|
+
console.log(e)
|
|
574
|
+
}
|
|
575
|
+
})()
|