@bprotsyk/aso-core 1.2.177 → 1.2.179
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.
|
@@ -10,7 +10,7 @@ declare function updateCampaign(id: number, payload: Partial<IKeitaroCampaign>):
|
|
|
10
10
|
declare function getAllOffers(): Promise<any[]>;
|
|
11
11
|
declare function getOfferByKeitaroId(id: number): Promise<any>;
|
|
12
12
|
declare function updateOffer(offer: any): Promise<any>;
|
|
13
|
-
declare function addOfferToKeitaro(offer: IOffer, affiliateId: number, link: string, groupId?: number): Promise<void>;
|
|
13
|
+
declare function addOfferToKeitaro(offer: IOffer, affiliateId: number, link: string, campaignGroupId?: number, groupId?: number): Promise<void>;
|
|
14
14
|
declare function createCampaign(campaignData: Partial<IKeitaroCampaign>): Promise<IKeitaroCampaign>;
|
|
15
15
|
declare function getCampaignById(id: number): Promise<IKeitaroCampaign>;
|
|
16
16
|
export declare function upsertStreamToCampaign(campaign: IKeitaroCampaign, stream: Partial<IKeitaroStream>): Promise<void>;
|
|
@@ -109,7 +109,7 @@ function createStreamPartialPayload(keitaroOfferId, offerName, offerId, offerGeo
|
|
|
109
109
|
}],
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
async function addOfferToKeitaro(offer, affiliateId, link, groupId) {
|
|
112
|
+
async function addOfferToKeitaro(offer, affiliateId, link, campaignGroupId, groupId) {
|
|
113
113
|
// TODO look if offer already exists by offer.name
|
|
114
114
|
let allOffers = await getAllOffers();
|
|
115
115
|
let identicalOffer = allOffers.find((o) => { return o.name.includes(offer.name); });
|
|
@@ -133,7 +133,7 @@ async function addOfferToKeitaro(offer, affiliateId, link, groupId) {
|
|
|
133
133
|
keitaroOfferId = keitaroOffer.id;
|
|
134
134
|
}
|
|
135
135
|
let streamPartialPayload = createStreamPartialPayload(keitaroOfferId, offer.caption, offer.name, offer.geo);
|
|
136
|
-
await createStreamForMatchingCampaigns(streamPartialPayload, offer.name, /^(FA #|A #)
|
|
136
|
+
await createStreamForMatchingCampaigns(streamPartialPayload, offer.name, /^(FA #|A #)/, campaignGroupId);
|
|
137
137
|
}
|
|
138
138
|
async function createCampaign(campaignData) {
|
|
139
139
|
let { data: campaign } = await http_1.default.post(`/campaigns`, campaignData);
|
|
@@ -473,7 +473,7 @@ let moveCampaignsToAnotherGroup = async () => {
|
|
|
473
473
|
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];
|
|
474
474
|
await keitaro_service_1.KeitaroService.changeCampaignsGroup(from, to, exceptFor);
|
|
475
475
|
};
|
|
476
|
-
moveCampaignsToAnotherGroup()
|
|
476
|
+
// moveCampaignsToAnotherGroup()
|
|
477
477
|
// Getting campaign group ids
|
|
478
478
|
// (async () => {
|
|
479
479
|
// let campaigns = await KeitaroService.getAllCampaigns()
|
package/package.json
CHANGED
|
@@ -130,7 +130,7 @@ function createStreamPartialPayload(keitaroOfferId: number, offerName: string, o
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
async function addOfferToKeitaro(offer: IOffer, affiliateId: number, link: string, groupId?: number) {
|
|
133
|
+
async function addOfferToKeitaro(offer: IOffer, affiliateId: number, link: string,campaignGroupId?: number, groupId?: number) {
|
|
134
134
|
// TODO look if offer already exists by offer.name
|
|
135
135
|
let allOffers = await getAllOffers()
|
|
136
136
|
let identicalOffer = allOffers.find((o) => { return o.name.includes(offer.name) })
|
|
@@ -158,7 +158,7 @@ async function addOfferToKeitaro(offer: IOffer, affiliateId: number, link: strin
|
|
|
158
158
|
|
|
159
159
|
let streamPartialPayload = createStreamPartialPayload(keitaroOfferId, offer.caption, offer.name, offer.geo)
|
|
160
160
|
|
|
161
|
-
await createStreamForMatchingCampaigns(streamPartialPayload, offer.name, /^(FA #|A #)
|
|
161
|
+
await createStreamForMatchingCampaigns(streamPartialPayload, offer.name, /^(FA #|A #)/, campaignGroupId)
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
async function createCampaign(campaignData: Partial<IKeitaroCampaign>): Promise<IKeitaroCampaign> {
|
|
@@ -539,7 +539,7 @@ let moveCampaignsToAnotherGroup = async () => {
|
|
|
539
539
|
await KeitaroService.changeCampaignsGroup(from, to, exceptFor)
|
|
540
540
|
}
|
|
541
541
|
|
|
542
|
-
moveCampaignsToAnotherGroup()
|
|
542
|
+
// moveCampaignsToAnotherGroup()
|
|
543
543
|
|
|
544
544
|
// Getting campaign group ids
|
|
545
545
|
// (async () => {
|