@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.
@@ -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 { IApp, IAppKeitaroData, IntegrationType } from "../../app/app";
6
- import { IKeitaroOffer } from "../../keitaro/keitaro-offer";
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 getCampaignById(id: number): Promise<IKeitaroCampaign>;
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 getAllOffers(): Promise<IKeitaroOffer[]>;
19
- /**
20
- * Create offer in Keitaro from our IOffer
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
- createStream: typeof createStream;
62
- getDomains: typeof getDomains;
35
+ updateCampaign: typeof updateCampaign;
36
+ getAllCampaigns: typeof getAllCampaigns;
63
37
  getAllOffers: typeof getAllOffers;
64
- createOfferInKeitaro: typeof createOfferInKeitaro;
65
- addOfferToKeitaro: typeof addOfferToKeitaro;
66
- generateAlias: typeof generateAlias;
67
- campaignToKeitaroData: typeof campaignToKeitaroData;
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 default KeitaroService;
55
+ export {};