@bprotsyk/aso-core 2.1.185 → 2.1.187
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/index.d.ts +1 -1
- package/lib/network/keitaro/traffle/traffle-keitaro-service.js +63 -54
- package/lib/panel/app/upsert-flash-app-request.d.ts +2 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/network/keitaro/traffle/traffle-keitaro-service.ts +68 -66
- package/src/panel/app/upsert-flash-app-request.ts +2 -1
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { IPush } from "./general/push";
|
|
|
2
2
|
export { IOffer, IPartner, IOfferType } from "./offers/offer";
|
|
3
3
|
export { IOffersSection, OffersSectionSchema, DefaultSectionId } from "./offers/section";
|
|
4
4
|
export { IAppOffersSection, ISectionsList, SectionsListSchema, IOfferState } from "./offers/list";
|
|
5
|
-
export { IAdjustEventIds, IntegrationVersion, IApp, AppSchema, PlugType, IAppKeitaroData, IPlatformParams, EPlatform, AppStatus, IRemovalInfo, EDirectType, IAppsflyerPostback } from "./app/app";
|
|
5
|
+
export { IAdjustEventIds, IntegrationVersion, IApp, AppSchema, PlugType, IAppKeitaroData, IPlatformParams, EPlatform, AppStatus, IRemovalInfo, EDirectType, IAppsflyerPostback, IBannerParams } from "./app/app";
|
|
6
6
|
export { IAppListItem } from "./app/app-list-item";
|
|
7
7
|
export { AppType } from "./app/app-type";
|
|
8
8
|
export { AlternativeLayoutType, AlternativeSourceType, AlternativeLogicType, AlternativeNetworkTool, AlternativeStorageType, AlternativeNavigation, AlternativeOnBackPressed, AlternativeOnActivityResult, IAppIntegration as IFlashIntegration } from "./app/app-integration";
|
|
@@ -291,23 +291,25 @@ async function checkAndUpdateCampaignParameters(existingCampaign, app, platform)
|
|
|
291
291
|
}
|
|
292
292
|
console.log("Parameters are up to date, no update needed");
|
|
293
293
|
// Always add postback even if no parameter update is needed
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
294
|
+
// COMMENTED OUT: Automatic S2S postback addition
|
|
295
|
+
// try {
|
|
296
|
+
// console.log(`[Traffle] Adding postback to campaign ${existingCampaign.id} (no parameter update needed)`);
|
|
297
|
+
// const postbackUrl = `https://traffle-tech.com/lander/appsflyer-s2s/index.php?status={status}&bundle_id={sub_id_16}&advertising_id={sub_id_17}&appsflyer_device_id={sub_id_18}&appsflyer_dev_key={sub_id_19}`;
|
|
298
|
+
//
|
|
299
|
+
// await keitaroApi.put(`/campaigns/${existingCampaign.id}`, {
|
|
300
|
+
// postbacks: [{
|
|
301
|
+
// id: 0,
|
|
302
|
+
// campaign_id: existingCampaign.id,
|
|
303
|
+
// method: "GET",
|
|
304
|
+
// statuses: ["lead", "sale", "rejected", "rebill"],
|
|
305
|
+
// url: postbackUrl
|
|
306
|
+
// }]
|
|
307
|
+
// });
|
|
308
|
+
//
|
|
309
|
+
// console.log(`[Traffle] Postback added to campaign ${existingCampaign.id}`);
|
|
310
|
+
// } catch (error) {
|
|
311
|
+
// console.error(`[Traffle] Failed to add postback to campaign ${existingCampaign.id}:`, error);
|
|
312
|
+
// }
|
|
311
313
|
return false;
|
|
312
314
|
}
|
|
313
315
|
return false;
|
|
@@ -1039,43 +1041,50 @@ async function updateCampaignNamesToNewPattern(requireConfirmation = false) {
|
|
|
1039
1041
|
}
|
|
1040
1042
|
}
|
|
1041
1043
|
exports.updateCampaignNamesToNewPattern = updateCampaignNamesToNewPattern;
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1044
|
+
// COMMENTED OUT: Automatic S2S postback addition function
|
|
1045
|
+
// async function ensurePostbacksForCampaign(campaignId: number, appId: number, bundle: string): Promise<void> {
|
|
1046
|
+
// try {
|
|
1047
|
+
// console.log(`[Traffle] Starting ensurePostbacksForCampaign for campaign ${campaignId}, app ${appId}, bundle ${bundle}`)
|
|
1048
|
+
//
|
|
1049
|
+
// const postbackUrl = `https://traffle-tech.com/lander/appsflyer-s2s/index.php?status={status}&bundle_id={sub_id_16}&advertising_id={sub_id_17}&appsflyer_device_id={sub_id_18}&appsflyer_dev_key={sub_id_19}`
|
|
1050
|
+
//
|
|
1051
|
+
// // Check if postback already exists
|
|
1052
|
+
// console.log(`[Traffle] Getting existing postbacks for campaign ${campaignId}`)
|
|
1053
|
+
// const existingPostbacks = await getCampaignPostbacks(campaignId)
|
|
1054
|
+
// console.log(`[Traffle] Existing postbacks:`, existingPostbacks)
|
|
1055
|
+
//
|
|
1056
|
+
// const postbackExists = existingPostbacks?.some(postback =>
|
|
1057
|
+
// postback.url === postbackUrl &&
|
|
1058
|
+
// postback.method === "GET" &&
|
|
1059
|
+
// postback.statuses?.includes("lead")
|
|
1060
|
+
// )
|
|
1061
|
+
// if (postbackExists) {
|
|
1062
|
+
// console.log(`[Traffle] AppsFlyer postback already exists for Traffle campaign ${campaignId}, skipping`)
|
|
1063
|
+
// return
|
|
1064
|
+
// }
|
|
1065
|
+
//
|
|
1066
|
+
// const postbackData = {
|
|
1067
|
+
// id: 0, // Will be set by Traffle
|
|
1068
|
+
// campaign_id: campaignId,
|
|
1069
|
+
// method: "GET",
|
|
1070
|
+
// statuses: ["lead", "sale", "rejected", "rebill"],
|
|
1071
|
+
// url: postbackUrl
|
|
1072
|
+
// }
|
|
1073
|
+
// console.log(`[Traffle] Adding AppsFlyer postback to Traffle campaign ${campaignId}:`, postbackData)
|
|
1074
|
+
// // Use Traffle API to add postback via campaign update
|
|
1075
|
+
// console.log(`[Traffle] Making PUT request to /campaigns/${campaignId} with postbacks:`, [postbackData])
|
|
1076
|
+
//
|
|
1077
|
+
// const response = await keitaroApi.put(`/campaigns/${campaignId}`, {
|
|
1078
|
+
// postbacks: [postbackData]
|
|
1079
|
+
// })
|
|
1080
|
+
// console.log(`[Traffle] Postback creation response:`, response.status, response.data?.postbacks)
|
|
1081
|
+
// if (response.status === 200) {
|
|
1082
|
+
// console.log(`[Traffle] Successfully added AppsFlyer postback to Traffle campaign ${campaignId}`)
|
|
1083
|
+
// }
|
|
1084
|
+
// } catch (error) {
|
|
1085
|
+
// console.error(`Failed to add AppsFlyer postback to Traffle campaign ${campaignId}:`, error)
|
|
1086
|
+
// }
|
|
1087
|
+
// }
|
|
1079
1088
|
async function getCampaignPostbacks(campaignId) {
|
|
1080
1089
|
try {
|
|
1081
1090
|
console.log(`[Traffle] Getting postbacks for campaign ${campaignId}`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppStatus, IAppKeitaroData, IBannerParams, IDomainParams, IPlatformParams } from "app/app";
|
|
1
|
+
import { AppStatus, ETeam, IAppKeitaroData, IBannerParams, IDomainParams, IPlatformParams } from "app/app";
|
|
2
2
|
export interface IUpsertAppRequest {
|
|
3
3
|
id: number;
|
|
4
4
|
name?: string;
|
|
@@ -17,6 +17,7 @@ export interface IUpsertAppRequest {
|
|
|
17
17
|
file?: any;
|
|
18
18
|
status?: AppStatus;
|
|
19
19
|
policyPath?: string;
|
|
20
|
+
team?: ETeam;
|
|
20
21
|
}
|
|
21
22
|
export interface IUpsertAppResponse {
|
|
22
23
|
data: IUpsertAppRequest;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { IOffer, IPartner, IOfferType } from "./offers/offer"
|
|
|
4
4
|
export { IOffersSection, OffersSectionSchema, DefaultSectionId } from "./offers/section"
|
|
5
5
|
export { IAppOffersSection, ISectionsList, SectionsListSchema, IOfferState } from "./offers/list"
|
|
6
6
|
|
|
7
|
-
export { IAdjustEventIds, IntegrationVersion, IApp, AppSchema, PlugType, IAppKeitaroData, IPlatformParams, EPlatform, AppStatus, IRemovalInfo, EDirectType, IAppsflyerPostback } from "./app/app"
|
|
7
|
+
export { IAdjustEventIds, IntegrationVersion, IApp, AppSchema, PlugType, IAppKeitaroData, IPlatformParams, EPlatform, AppStatus, IRemovalInfo, EDirectType, IAppsflyerPostback, IBannerParams } from "./app/app"
|
|
8
8
|
export { IAppListItem } from "./app/app-list-item"
|
|
9
9
|
export { AppType } from "./app/app-type"
|
|
10
10
|
export { AlternativeLayoutType, AlternativeSourceType, AlternativeLogicType, AlternativeNetworkTool, AlternativeStorageType, AlternativeNavigation, AlternativeOnBackPressed, AlternativeOnActivityResult, IAppIntegration as IFlashIntegration } from "./app/app-integration"
|
|
@@ -380,24 +380,25 @@ async function checkAndUpdateCampaignParameters(existingCampaign: IKeitaroCampai
|
|
|
380
380
|
console.log("Parameters are up to date, no update needed");
|
|
381
381
|
|
|
382
382
|
// Always add postback even if no parameter update is needed
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
383
|
+
// COMMENTED OUT: Automatic S2S postback addition
|
|
384
|
+
// try {
|
|
385
|
+
// console.log(`[Traffle] Adding postback to campaign ${existingCampaign.id} (no parameter update needed)`);
|
|
386
|
+
// const postbackUrl = `https://traffle-tech.com/lander/appsflyer-s2s/index.php?status={status}&bundle_id={sub_id_16}&advertising_id={sub_id_17}&appsflyer_device_id={sub_id_18}&appsflyer_dev_key={sub_id_19}`;
|
|
387
|
+
//
|
|
388
|
+
// await keitaroApi.put(`/campaigns/${existingCampaign.id}`, {
|
|
389
|
+
// postbacks: [{
|
|
390
|
+
// id: 0,
|
|
391
|
+
// campaign_id: existingCampaign.id,
|
|
392
|
+
// method: "GET",
|
|
393
|
+
// statuses: ["lead", "sale", "rejected", "rebill"],
|
|
394
|
+
// url: postbackUrl
|
|
395
|
+
// }]
|
|
396
|
+
// });
|
|
397
|
+
//
|
|
398
|
+
// console.log(`[Traffle] Postback added to campaign ${existingCampaign.id}`);
|
|
399
|
+
// } catch (error) {
|
|
400
|
+
// console.error(`[Traffle] Failed to add postback to campaign ${existingCampaign.id}:`, error);
|
|
401
|
+
// }
|
|
401
402
|
|
|
402
403
|
return false;
|
|
403
404
|
}
|
|
@@ -1226,54 +1227,55 @@ export async function updateCampaignNamesToNewPattern(requireConfirmation: boole
|
|
|
1226
1227
|
}
|
|
1227
1228
|
}
|
|
1228
1229
|
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
}
|
|
1230
|
+
// COMMENTED OUT: Automatic S2S postback addition function
|
|
1231
|
+
// async function ensurePostbacksForCampaign(campaignId: number, appId: number, bundle: string): Promise<void> {
|
|
1232
|
+
// try {
|
|
1233
|
+
// console.log(`[Traffle] Starting ensurePostbacksForCampaign for campaign ${campaignId}, app ${appId}, bundle ${bundle}`)
|
|
1234
|
+
//
|
|
1235
|
+
// const postbackUrl = `https://traffle-tech.com/lander/appsflyer-s2s/index.php?status={status}&bundle_id={sub_id_16}&advertising_id={sub_id_17}&appsflyer_device_id={sub_id_18}&appsflyer_dev_key={sub_id_19}`
|
|
1236
|
+
//
|
|
1237
|
+
// // Check if postback already exists
|
|
1238
|
+
// console.log(`[Traffle] Getting existing postbacks for campaign ${campaignId}`)
|
|
1239
|
+
// const existingPostbacks = await getCampaignPostbacks(campaignId)
|
|
1240
|
+
// console.log(`[Traffle] Existing postbacks:`, existingPostbacks)
|
|
1241
|
+
//
|
|
1242
|
+
// const postbackExists = existingPostbacks?.some(postback =>
|
|
1243
|
+
// postback.url === postbackUrl &&
|
|
1244
|
+
// postback.method === "GET" &&
|
|
1245
|
+
// postback.statuses?.includes("lead")
|
|
1246
|
+
// )
|
|
1247
|
+
|
|
1248
|
+
// if (postbackExists) {
|
|
1249
|
+
// console.log(`[Traffle] AppsFlyer postback already exists for Traffle campaign ${campaignId}, skipping`)
|
|
1250
|
+
// return
|
|
1251
|
+
// }
|
|
1252
|
+
//
|
|
1253
|
+
// const postbackData = {
|
|
1254
|
+
// id: 0, // Will be set by Traffle
|
|
1255
|
+
// campaign_id: campaignId,
|
|
1256
|
+
// method: "GET",
|
|
1257
|
+
// statuses: ["lead", "sale", "rejected", "rebill"],
|
|
1258
|
+
// url: postbackUrl
|
|
1259
|
+
// }
|
|
1260
|
+
|
|
1261
|
+
// console.log(`[Traffle] Adding AppsFlyer postback to Traffle campaign ${campaignId}:`, postbackData)
|
|
1262
|
+
|
|
1263
|
+
// // Use Traffle API to add postback via campaign update
|
|
1264
|
+
// console.log(`[Traffle] Making PUT request to /campaigns/${campaignId} with postbacks:`, [postbackData])
|
|
1265
|
+
//
|
|
1266
|
+
// const response = await keitaroApi.put(`/campaigns/${campaignId}`, {
|
|
1267
|
+
// postbacks: [postbackData]
|
|
1268
|
+
// })
|
|
1269
|
+
|
|
1270
|
+
// console.log(`[Traffle] Postback creation response:`, response.status, response.data?.postbacks)
|
|
1271
|
+
|
|
1272
|
+
// if (response.status === 200) {
|
|
1273
|
+
// console.log(`[Traffle] Successfully added AppsFlyer postback to Traffle campaign ${campaignId}`)
|
|
1274
|
+
// }
|
|
1275
|
+
// } catch (error) {
|
|
1276
|
+
// console.error(`Failed to add AppsFlyer postback to Traffle campaign ${campaignId}:`, error)
|
|
1277
|
+
// }
|
|
1278
|
+
// }
|
|
1277
1279
|
|
|
1278
1280
|
async function getCampaignPostbacks(campaignId: number): Promise<any[] | null> {
|
|
1279
1281
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppStatus, IAppKeitaroData, IBannerParams, IDomainParams, IPlatformParams, IPrivacyPolicyParams, IRemoveDataParams } from "app/app"
|
|
1
|
+
import { AppStatus, ETeam, IAppKeitaroData, IBannerParams, IDomainParams, IPlatformParams, IPrivacyPolicyParams, IRemoveDataParams } from "app/app"
|
|
2
2
|
import { PlugType } from "index"
|
|
3
3
|
|
|
4
4
|
export interface IUpsertAppRequest {
|
|
@@ -22,6 +22,7 @@ export interface IUpsertAppRequest {
|
|
|
22
22
|
file?: any
|
|
23
23
|
status?: AppStatus
|
|
24
24
|
policyPath?: string
|
|
25
|
+
team?: ETeam
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export interface IUpsertAppResponse {
|