@bprotsyk/aso-core 2.1.224 → 2.1.225
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 +237 -363
- package/lib/app/app.js +93 -176
- package/lib/general/cloudflare-domain.d.ts +1 -0
- package/lib/general/domain.d.ts +82 -0
- package/lib/general/domain.js +5 -0
- package/lib/index.d.ts +5 -2
- package/lib/index.js +21 -17
- package/lib/keitaro/keitaro-campaign.d.ts +0 -1
- package/lib/keitaro/keitaro-offer.d.ts +3 -14
- package/lib/network/keitaro/http.js +1 -1
- package/lib/network/keitaro/keitaro-service.d.ts +37 -51
- package/lib/network/keitaro/keitaro-service.js +442 -192
- package/lib/offers/list.d.ts +18 -18
- package/lib/offers/offer.d.ts +4 -0
- package/lib/offers/offer.js +1 -0
- package/lib/panel/app/upsert-flash-app-request.d.ts +14 -14
- package/lib/server/server.d.ts +140 -0
- package/lib/server/server.js +36 -0
- package/lib/utils/keitaro-utils.d.ts +1 -1
- package/lib/utils/keitaro-utils.js +9 -722
- package/package.json +1 -1
- package/src/app/app.ts +316 -308
- package/src/general/cloudflare-domain.ts +1 -0
- package/src/general/domain.ts +8 -0
- package/src/index.ts +27 -30
- package/src/keitaro/keitaro-campaign.ts +0 -1
- package/src/keitaro/keitaro-offer.ts +3 -14
- package/src/network/keitaro/http.ts +1 -1
- package/src/network/keitaro/keitaro-service.ts +533 -232
- package/src/offers/offer.ts +2 -0
- package/src/panel/app/upsert-flash-app-request.ts +48 -0
- package/src/server/server.ts +57 -0
- package/src/utils/keitaro-utils.ts +24 -0
|
@@ -2,8 +2,9 @@ import { IKeitaroStream } from "../../keitaro/keitaro-stream";
|
|
|
2
2
|
import { IOffer } from "../../offers/offer";
|
|
3
3
|
import { IKeitaroCampaign } from "../../keitaro/keitaro-campaign";
|
|
4
4
|
import { IKeitaroDomain } from "../../keitaro/keitaro-domain";
|
|
5
|
-
import {
|
|
6
|
-
import { IKeitaroOffer } from "
|
|
5
|
+
import { EPlatform, IApp } from "../../app/app";
|
|
6
|
+
import { IKeitaroOffer } from "index";
|
|
7
|
+
import { IKeitaroClicksRequest, KeitaroClicksInterval } from "../../keitaro/keitaro-clicks";
|
|
7
8
|
export interface IKeitaroOffersFilter {
|
|
8
9
|
keitaroId?: number;
|
|
9
10
|
name?: string;
|
|
@@ -11,59 +12,44 @@ export interface IKeitaroOffersFilter {
|
|
|
11
12
|
}
|
|
12
13
|
declare function getStreamsByCampaignId(campaignId: number): Promise<IKeitaroStream[]>;
|
|
13
14
|
declare function getAllCampaigns(): Promise<IKeitaroCampaign[]>;
|
|
14
|
-
declare function
|
|
15
|
+
declare function cloneStreams(originalCampaignId: number, streamPositionsToClone: number[], campaignRegExp: RegExp): Promise<void>;
|
|
15
16
|
declare function updateCampaign(id: number, payload: Partial<IKeitaroCampaign>): Promise<void>;
|
|
17
|
+
declare function getAllOffers(): Promise<IKeitaroOffer[]>;
|
|
18
|
+
declare function findKeitaroOffers(filter: IKeitaroOffersFilter): Promise<IKeitaroOffer[]>;
|
|
19
|
+
declare function getOfferByKeitaroId(id: number): Promise<IKeitaroOffer>;
|
|
20
|
+
declare function updateOffer(offer: any): Promise<IKeitaroOffer>;
|
|
21
|
+
declare function addOffersToKeitaro(offers: IOffer[], affiliateId: number, links: string[], avoidGroup?: number, groupId?: number): Promise<void>;
|
|
16
22
|
declare function createCampaign(campaignData: Partial<IKeitaroCampaign>): Promise<IKeitaroCampaign>;
|
|
23
|
+
declare function getCampaignById(id: number): Promise<IKeitaroCampaign>;
|
|
24
|
+
export declare function upsertStreamToCampaign(campaign: IKeitaroCampaign, stream: Partial<IKeitaroStream>): Promise<void>;
|
|
25
|
+
declare function cloneOWCampaign(app: IApp, platform?: EPlatform): Promise<IKeitaroCampaign | any>;
|
|
26
|
+
declare function cloneDirectCampaign(app: IApp, platform?: EPlatform, addDefaultStreams?: boolean): Promise<IKeitaroCampaign | any>;
|
|
27
|
+
declare function cloneDCampaign(app: IApp): Promise<IKeitaroCampaign>;
|
|
28
|
+
declare function changeCampaignsGroup(fromId: number, toId: number, exceptForCampaignIds: number[], onlyForCampaignIds?: number[]): Promise<void>;
|
|
17
29
|
declare function getDomains(onlyActive?: boolean): Promise<IKeitaroDomain[]>;
|
|
18
|
-
declare function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* @param offer - Our internal IOffer object
|
|
22
|
-
* @returns Keitaro offer with ID
|
|
23
|
-
*/
|
|
24
|
-
declare function createOfferInKeitaro(offer: IOffer): Promise<IKeitaroOffer>;
|
|
25
|
-
declare function createStream(campaignId: number, streamData: Partial<IKeitaroStream>): Promise<IKeitaroStream>;
|
|
26
|
-
/**
|
|
27
|
-
* Get all offerwall campaigns (campaigns with [◈] prefix in group 106)
|
|
28
|
-
*/
|
|
29
|
-
declare function getOfferwallCampaigns(): Promise<IKeitaroCampaign[]>;
|
|
30
|
-
/**
|
|
31
|
-
* Add our IOffer to Keitaro and distribute to all offerwall campaigns
|
|
32
|
-
* @param offer - Our internal IOffer object
|
|
33
|
-
* @returns Result with Keitaro offer ID and distribution stats
|
|
34
|
-
*/
|
|
35
|
-
declare function addOfferToKeitaro(offer: IOffer): Promise<{
|
|
36
|
-
keitaroOfferId: number;
|
|
37
|
-
success: number;
|
|
38
|
-
failed: number;
|
|
39
|
-
campaigns: string[];
|
|
40
|
-
}>;
|
|
41
|
-
declare function generateAlias(): string;
|
|
42
|
-
/**
|
|
43
|
-
* Clone a campaign for an app based on integration type
|
|
44
|
-
* @param app - The app to create campaign for
|
|
45
|
-
* @param integrationType - OFFERWALL or DIRECT
|
|
46
|
-
* @returns Keitaro data for the cloned campaign
|
|
47
|
-
*/
|
|
48
|
-
declare function cloneCampaignForApp(app: IApp, integrationType: IntegrationType): Promise<IAppKeitaroData>;
|
|
49
|
-
/**
|
|
50
|
-
* Convert a Keitaro campaign to IAppKeitaroData
|
|
51
|
-
*/
|
|
52
|
-
declare function campaignToKeitaroData(campaign: IKeitaroCampaign): IAppKeitaroData;
|
|
30
|
+
declare function getProfitForTimeRange(from: number, to: number): Promise<number>;
|
|
31
|
+
declare function fixBrokenClickCosts(startDate: string, endDate: string): Promise<void>;
|
|
32
|
+
declare function getClicks(request: IKeitaroClicksRequest | KeitaroClicksInterval): Promise<any>;
|
|
53
33
|
export declare const KeitaroService: {
|
|
54
|
-
getAllCampaigns: typeof getAllCampaigns;
|
|
55
|
-
getCampaignById: typeof getCampaignById;
|
|
56
|
-
createCampaign: typeof createCampaign;
|
|
57
|
-
updateCampaign: typeof updateCampaign;
|
|
58
|
-
cloneCampaignForApp: typeof cloneCampaignForApp;
|
|
59
|
-
getOfferwallCampaigns: typeof getOfferwallCampaigns;
|
|
60
34
|
getStreamsByCampaignId: typeof getStreamsByCampaignId;
|
|
61
|
-
|
|
62
|
-
|
|
35
|
+
updateCampaign: typeof updateCampaign;
|
|
36
|
+
getAllCampaigns: typeof getAllCampaigns;
|
|
63
37
|
getAllOffers: typeof getAllOffers;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
38
|
+
cloneStreams: typeof cloneStreams;
|
|
39
|
+
addOffersToKeitaro: typeof addOffersToKeitaro;
|
|
40
|
+
getOfferByKeitaroId: typeof getOfferByKeitaroId;
|
|
41
|
+
getDomains: typeof getDomains;
|
|
42
|
+
createCampaign: typeof createCampaign;
|
|
43
|
+
getCampaignById: typeof getCampaignById;
|
|
44
|
+
upsertStreamToCampaign: typeof upsertStreamToCampaign;
|
|
45
|
+
cloneOWCampaign: typeof cloneOWCampaign;
|
|
46
|
+
updateOffer: typeof updateOffer;
|
|
47
|
+
changeCampaignsGroup: typeof changeCampaignsGroup;
|
|
48
|
+
getProfitForTimeRange: typeof getProfitForTimeRange;
|
|
49
|
+
getClicks: typeof getClicks;
|
|
50
|
+
cloneDCampaign: typeof cloneDCampaign;
|
|
51
|
+
findKeitaroOffers: typeof findKeitaroOffers;
|
|
52
|
+
fixBrokenClickCosts: typeof fixBrokenClickCosts;
|
|
53
|
+
cloneDirectCampaign: typeof cloneDirectCampaign;
|
|
68
54
|
};
|
|
69
|
-
export
|
|
55
|
+
export {};
|