@bprotsyk/aso-core 2.1.31 → 2.1.32
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.
|
@@ -26,7 +26,6 @@ declare function cloneDCampaign(app: IApp): Promise<IKeitaroCampaign>;
|
|
|
26
26
|
declare function changeCampaignsGroup(fromId: number, toId: number, exceptForCampaignIds: number[], onlyForCampaignIds?: number[]): Promise<void>;
|
|
27
27
|
declare function getDomains(onlyActive?: boolean): Promise<IKeitaroDomain[]>;
|
|
28
28
|
declare function getProfitForTimeRange(from: number, to: number): Promise<number>;
|
|
29
|
-
declare function getProfitForTodayAndYesterday(): Promise<any>;
|
|
30
29
|
export declare const KeitaroService: {
|
|
31
30
|
getStreamsByCampaignId: typeof getStreamsByCampaignId;
|
|
32
31
|
updateCampaign: typeof updateCampaign;
|
|
@@ -43,7 +42,6 @@ export declare const KeitaroService: {
|
|
|
43
42
|
updateOffer: typeof updateOffer;
|
|
44
43
|
changeCampaignsGroup: typeof changeCampaignsGroup;
|
|
45
44
|
getProfitForTimeRange: typeof getProfitForTimeRange;
|
|
46
|
-
getProfitForTodayAndYesterday: typeof getProfitForTodayAndYesterday;
|
|
47
45
|
cloneDCampaign: typeof cloneDCampaign;
|
|
48
46
|
findKeitaroOffers: typeof findKeitaroOffers;
|
|
49
47
|
};
|
|
@@ -173,9 +173,9 @@ async function upsertStreamToCampaign(campaign, stream) {
|
|
|
173
173
|
}
|
|
174
174
|
exports.upsertStreamToCampaign = upsertStreamToCampaign;
|
|
175
175
|
async function cloneOWCampaign(app) {
|
|
176
|
-
let name = `#${app.id} [◈]
|
|
176
|
+
let name = `#${app.id} [◈]`;
|
|
177
177
|
let allCampaigns = await getAllCampaigns();
|
|
178
|
-
let matchingCampaign = allCampaigns.filter((c) =>
|
|
178
|
+
let matchingCampaign = allCampaigns.filter((c) => new RegExp(`#${app.id}.*◈`).test(c.name));
|
|
179
179
|
if (matchingCampaign.length > 0)
|
|
180
180
|
return matchingCampaign[0];
|
|
181
181
|
const { data: campaigns } = await http_1.default.post(`/campaigns/2673/clone`);
|
|
@@ -246,16 +246,18 @@ async function getProfitForTimeRange(from, to) {
|
|
|
246
246
|
});
|
|
247
247
|
return data.rows[0].profit;
|
|
248
248
|
}
|
|
249
|
-
async function getProfitForTodayAndYesterday() {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
249
|
+
// async function getProfitForTodayAndYesterday(): Promise<any> {
|
|
250
|
+
// let timestamps = getTimestampsForTodayAndYesterday()
|
|
251
|
+
// let today = await KeitaroService.getProfitForTimeRange(timestamps.today.start, timestamps.today.end)
|
|
252
|
+
// let yesterday = await KeitaroService.getProfitForTimeRange(timestamps.yesterday.start, timestamps.yesterday.end)
|
|
253
|
+
// return {
|
|
254
|
+
// today: today,
|
|
255
|
+
// yesterday: yesterday
|
|
256
|
+
// }
|
|
257
|
+
// }
|
|
258
258
|
exports.KeitaroService = {
|
|
259
259
|
getStreamsByCampaignId, updateCampaign, getAllCampaigns, getAllOffers, cloneStreams, addOfferToKeitaro, getOfferByKeitaroId, getDomains, createCampaign, getCampaignById, upsertStreamToCampaign, cloneOWCampaign,
|
|
260
|
-
updateOffer, changeCampaignsGroup, getProfitForTimeRange,
|
|
260
|
+
updateOffer, changeCampaignsGroup, getProfitForTimeRange,
|
|
261
|
+
// getProfitForTodayAndYesterday,
|
|
262
|
+
cloneDCampaign, findKeitaroOffers
|
|
261
263
|
};
|
|
@@ -565,5 +565,5 @@ let renameCampaigns = async () => {
|
|
|
565
565
|
// gatherInfoForFlashApps()
|
|
566
566
|
// replaceInOfferLink(`xmariorel.com`, `lalielynaualish.com`, /.*icecasino_huffson.*/g)
|
|
567
567
|
// replaceInOfferLink(`lp=18`, `lp=00`, /.*icecasino_huffson.*/g)
|
|
568
|
-
let test = async () => console.log(await
|
|
569
|
-
test()
|
|
568
|
+
// let test = async () => console.log(await KeitaroService.getProfitForTodayAndYesterday())
|
|
569
|
+
// test()
|
package/package.json
CHANGED
|
@@ -211,10 +211,10 @@ export async function upsertStreamToCampaign(campaign: IKeitaroCampaign, stream:
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
async function cloneOWCampaign(app: IApp): Promise<IKeitaroCampaign> {
|
|
214
|
-
let name = `#${app.id} [◈]
|
|
214
|
+
let name = `#${app.id} [◈]`
|
|
215
215
|
|
|
216
216
|
let allCampaigns = await getAllCampaigns()
|
|
217
|
-
let matchingCampaign = allCampaigns.filter((c) =>
|
|
217
|
+
let matchingCampaign = allCampaigns.filter((c) => new RegExp(`#${app.id}.*◈`).test(c.name))
|
|
218
218
|
if (matchingCampaign.length > 0) return matchingCampaign[0]
|
|
219
219
|
|
|
220
220
|
const { data: campaigns } = await keitaroApi.post(`/campaigns/2673/clone`);
|
|
@@ -306,18 +306,20 @@ async function getProfitForTimeRange(from: number, to: number): Promise<number>
|
|
|
306
306
|
return data.rows[0].profit
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
async function getProfitForTodayAndYesterday(): Promise<any> {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
309
|
+
// async function getProfitForTodayAndYesterday(): Promise<any> {
|
|
310
|
+
// let timestamps = getTimestampsForTodayAndYesterday()
|
|
311
|
+
// let today = await KeitaroService.getProfitForTimeRange(timestamps.today.start, timestamps.today.end)
|
|
312
|
+
// let yesterday = await KeitaroService.getProfitForTimeRange(timestamps.yesterday.start, timestamps.yesterday.end)
|
|
313
313
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
314
|
+
// return {
|
|
315
|
+
// today: today,
|
|
316
|
+
// yesterday: yesterday
|
|
317
|
+
// }
|
|
318
|
+
// }
|
|
319
319
|
|
|
320
320
|
export const KeitaroService = {
|
|
321
321
|
getStreamsByCampaignId, updateCampaign, getAllCampaigns, getAllOffers, cloneStreams, addOfferToKeitaro, getOfferByKeitaroId, getDomains, createCampaign, getCampaignById, upsertStreamToCampaign, cloneOWCampaign,
|
|
322
|
-
updateOffer, changeCampaignsGroup, getProfitForTimeRange,
|
|
322
|
+
updateOffer, changeCampaignsGroup, getProfitForTimeRange,
|
|
323
|
+
// getProfitForTodayAndYesterday,
|
|
324
|
+
cloneDCampaign, findKeitaroOffers
|
|
323
325
|
}
|
|
@@ -660,5 +660,5 @@ let renameCampaigns = async () => {
|
|
|
660
660
|
|
|
661
661
|
// replaceInOfferLink(`xmariorel.com`, `lalielynaualish.com`, /.*icecasino_huffson.*/g)
|
|
662
662
|
// replaceInOfferLink(`lp=18`, `lp=00`, /.*icecasino_huffson.*/g)
|
|
663
|
-
let test = async () => console.log(await KeitaroService.getProfitForTodayAndYesterday())
|
|
664
|
-
test()
|
|
663
|
+
// let test = async () => console.log(await KeitaroService.getProfitForTodayAndYesterday())
|
|
664
|
+
// test()
|