@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 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
- try {
295
- console.log(`[Traffle] Adding postback to campaign ${existingCampaign.id} (no parameter update needed)`);
296
- 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}`;
297
- await http_1.default.put(`/campaigns/${existingCampaign.id}`, {
298
- postbacks: [{
299
- id: 0,
300
- campaign_id: existingCampaign.id,
301
- method: "GET",
302
- statuses: ["lead", "sale", "rejected", "rebill"],
303
- url: postbackUrl
304
- }]
305
- });
306
- console.log(`[Traffle] Postback added to campaign ${existingCampaign.id}`);
307
- }
308
- catch (error) {
309
- console.error(`[Traffle] Failed to add postback to campaign ${existingCampaign.id}:`, error);
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
- async function ensurePostbacksForCampaign(campaignId, appId, bundle) {
1043
- try {
1044
- console.log(`[Traffle] Starting ensurePostbacksForCampaign for campaign ${campaignId}, app ${appId}, bundle ${bundle}`);
1045
- 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}`;
1046
- // Check if postback already exists
1047
- console.log(`[Traffle] Getting existing postbacks for campaign ${campaignId}`);
1048
- const existingPostbacks = await getCampaignPostbacks(campaignId);
1049
- console.log(`[Traffle] Existing postbacks:`, existingPostbacks);
1050
- const postbackExists = existingPostbacks?.some(postback => postback.url === postbackUrl &&
1051
- postback.method === "GET" &&
1052
- postback.statuses?.includes("lead"));
1053
- if (postbackExists) {
1054
- console.log(`[Traffle] AppsFlyer postback already exists for Traffle campaign ${campaignId}, skipping`);
1055
- return;
1056
- }
1057
- const postbackData = {
1058
- id: 0,
1059
- campaign_id: campaignId,
1060
- method: "GET",
1061
- statuses: ["lead", "sale", "rejected", "rebill"],
1062
- url: postbackUrl
1063
- };
1064
- console.log(`[Traffle] Adding AppsFlyer postback to Traffle campaign ${campaignId}:`, postbackData);
1065
- // Use Traffle API to add postback via campaign update
1066
- console.log(`[Traffle] Making PUT request to /campaigns/${campaignId} with postbacks:`, [postbackData]);
1067
- const response = await http_1.default.put(`/campaigns/${campaignId}`, {
1068
- postbacks: [postbackData]
1069
- });
1070
- console.log(`[Traffle] Postback creation response:`, response.status, response.data?.postbacks);
1071
- if (response.status === 200) {
1072
- console.log(`[Traffle] Successfully added AppsFlyer postback to Traffle campaign ${campaignId}`);
1073
- }
1074
- }
1075
- catch (error) {
1076
- console.error(`Failed to add AppsFlyer postback to Traffle campaign ${campaignId}:`, error);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "2.1.185",
3
+ "version": "2.1.187",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
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
- try {
384
- console.log(`[Traffle] Adding postback to campaign ${existingCampaign.id} (no parameter update needed)`);
385
- 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}`;
386
-
387
- await keitaroApi.put(`/campaigns/${existingCampaign.id}`, {
388
- postbacks: [{
389
- id: 0,
390
- campaign_id: existingCampaign.id,
391
- method: "GET",
392
- statuses: ["lead", "sale", "rejected", "rebill"],
393
- url: postbackUrl
394
- }]
395
- });
396
-
397
- console.log(`[Traffle] Postback added to campaign ${existingCampaign.id}`);
398
- } catch (error) {
399
- console.error(`[Traffle] Failed to add postback to campaign ${existingCampaign.id}:`, error);
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
- async function ensurePostbacksForCampaign(campaignId: number, appId: number, bundle: string): Promise<void> {
1230
- try {
1231
- console.log(`[Traffle] Starting ensurePostbacksForCampaign for campaign ${campaignId}, app ${appId}, bundle ${bundle}`)
1232
-
1233
- 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}`
1234
-
1235
- // Check if postback already exists
1236
- console.log(`[Traffle] Getting existing postbacks for campaign ${campaignId}`)
1237
- const existingPostbacks = await getCampaignPostbacks(campaignId)
1238
- console.log(`[Traffle] Existing postbacks:`, existingPostbacks)
1239
-
1240
- const postbackExists = existingPostbacks?.some(postback =>
1241
- postback.url === postbackUrl &&
1242
- postback.method === "GET" &&
1243
- postback.statuses?.includes("lead")
1244
- )
1245
-
1246
- if (postbackExists) {
1247
- console.log(`[Traffle] AppsFlyer postback already exists for Traffle campaign ${campaignId}, skipping`)
1248
- return
1249
- }
1250
-
1251
- const postbackData = {
1252
- id: 0, // Will be set by Traffle
1253
- campaign_id: campaignId,
1254
- method: "GET",
1255
- statuses: ["lead", "sale", "rejected", "rebill"],
1256
- url: postbackUrl
1257
- }
1258
-
1259
- console.log(`[Traffle] Adding AppsFlyer postback to Traffle campaign ${campaignId}:`, postbackData)
1260
-
1261
- // Use Traffle API to add postback via campaign update
1262
- console.log(`[Traffle] Making PUT request to /campaigns/${campaignId} with postbacks:`, [postbackData])
1263
-
1264
- const response = await keitaroApi.put(`/campaigns/${campaignId}`, {
1265
- postbacks: [postbackData]
1266
- })
1267
-
1268
- console.log(`[Traffle] Postback creation response:`, response.status, response.data?.postbacks)
1269
-
1270
- if (response.status === 200) {
1271
- console.log(`[Traffle] Successfully added AppsFlyer postback to Traffle campaign ${campaignId}`)
1272
- }
1273
- } catch (error) {
1274
- console.error(`Failed to add AppsFlyer postback to Traffle campaign ${campaignId}:`, error)
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 {