@bprotsyk/aso-core 1.2.83 → 1.2.85
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/flash/flash-app.js +2 -2
- package/lib/utils/keitaro-utils.js +54 -64
- package/package.json +1 -1
- package/src/flash/flash-app.ts +2 -2
- package/src/utils/keitaro-utils.ts +58 -57
package/lib/flash/flash-app.js
CHANGED
|
@@ -63,7 +63,7 @@ exports.FlashAppSchema = new mongoose_1.Schema({
|
|
|
63
63
|
reservePlugType: {
|
|
64
64
|
type: String,
|
|
65
65
|
enum: FlashAppPlugStatus,
|
|
66
|
-
default:
|
|
66
|
+
default: FlashAppPlugStatus.DISABLED,
|
|
67
67
|
required: false
|
|
68
68
|
},
|
|
69
69
|
reservePlugContent: {
|
|
@@ -72,7 +72,7 @@ exports.FlashAppSchema = new mongoose_1.Schema({
|
|
|
72
72
|
},
|
|
73
73
|
reservePlugStatus: {
|
|
74
74
|
type: String,
|
|
75
|
-
enum:
|
|
75
|
+
enum: FlashAppPlugStatus,
|
|
76
76
|
default: FlashAppPlugStatus.DISABLED,
|
|
77
77
|
required: false
|
|
78
78
|
},
|
|
@@ -391,78 +391,68 @@ let gatherInfoForFlashApps = async () => {
|
|
|
391
391
|
let result = [];
|
|
392
392
|
for (let [id, paste] of Object.entries(pasteMap)) {
|
|
393
393
|
console.log(`- #${id}`);
|
|
394
|
-
let ow = owCampaigns[id]
|
|
395
|
-
let redirect = redirectCampaigns[id]
|
|
396
|
-
let tracking = trackingMap[id]
|
|
394
|
+
// let ow = owCampaigns[id as keyof object] as IKeitaroCampaign | undefined
|
|
395
|
+
// let redirect = redirectCampaigns[id as keyof object] as IKeitaroCampaign | undefined
|
|
396
|
+
// let tracking = trackingMap[id as keyof object]
|
|
397
397
|
let app = flashApps[id];
|
|
398
398
|
if (!app) {
|
|
399
399
|
console.log(`! No app for ${id}`);
|
|
400
400
|
continue;
|
|
401
401
|
}
|
|
402
|
-
if (paste.status ==
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
let
|
|
423
|
-
let
|
|
424
|
-
let
|
|
425
|
-
let
|
|
426
|
-
let
|
|
427
|
-
let
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
let
|
|
431
|
-
let redirectCampaignAlias = redirect?.alias;
|
|
432
|
-
let clickIdParameterName = ow?.parameters?.sub_id_8?.name;
|
|
433
|
-
let offerIdParameterName = ow?.parameters?.sub_id_15?.name;
|
|
434
|
-
if (!clickIdParameterName && app && ow)
|
|
435
|
-
console.log(`No click id parameter for #${id}`);
|
|
436
|
-
if (!offerIdParameterName && app && ow)
|
|
437
|
-
console.log(`No offer id parameter for #${id}`);
|
|
438
|
-
let trackingLink = tracking?.trackingUrl;
|
|
402
|
+
// if (paste.status == FlashAppPlugStatus.ENABLED) {
|
|
403
|
+
// if (!ow) console.log(`#${id}: no OW`)
|
|
404
|
+
// if (!redirect) console.log(`No redirect for #${id}`)
|
|
405
|
+
// else if (!paste.content.includes(redirect.domain)) console.log(`#${id}: Redirect domain (${redirect.domain}) differs from paste domain (${paste.content})`)
|
|
406
|
+
// else if (!paste.content.includes(redirect.alias)) console.log(`#${id}: Redirect campaign alias (${redirect.alias}) differs from paste id (${paste.content})`)
|
|
407
|
+
// }
|
|
408
|
+
// let appId
|
|
409
|
+
// for (let parameter of Object.values(redirect?.parameters || {})) {
|
|
410
|
+
// if (parameter.name == "appId") {
|
|
411
|
+
// appId = parameter.placeholder
|
|
412
|
+
// }
|
|
413
|
+
// }
|
|
414
|
+
// if (!appId && ow) console.log(`No app id for #${id}`)
|
|
415
|
+
// else if (appId != id && ow) console.log(`Wrong app id (${appId}) for #${id}`)
|
|
416
|
+
// let owDomain = ow?.domain?.split("/")[2]
|
|
417
|
+
// let owDomainId = ow?.domain_id
|
|
418
|
+
// let owCampaignId = ow?.id
|
|
419
|
+
// let owCampaignName = ow?.name
|
|
420
|
+
// let owCampaignAlias = ow?.alias
|
|
421
|
+
// let redirectDomain = redirect?.domain?.split("/")[2]
|
|
422
|
+
// let redirectDomainId = redirect?.domain_id
|
|
423
|
+
// let redirectCampaignId = redirect?.id
|
|
424
|
+
// let redirectCampaignName = redirect?.name
|
|
425
|
+
// let redirectCampaignAlias = redirect?.alias
|
|
426
|
+
// let clickIdParameterName = ow?.parameters?.sub_id_8?.name
|
|
427
|
+
// let offerIdParameterName = ow?.parameters?.sub_id_15?.name
|
|
428
|
+
// if (!clickIdParameterName && app && ow) console.log(`No click id parameter for #${id}`)
|
|
429
|
+
// if (!offerIdParameterName && app && ow) console.log(`No offer id parameter for #${id}`)
|
|
430
|
+
// let trackingLink = tracking?.trackingUrl
|
|
439
431
|
app.plugStatus = paste.status;
|
|
440
432
|
app.plugContent = paste.content;
|
|
441
433
|
app.plugType = flash_app_1.PlugType.PASTEBIN;
|
|
442
434
|
app.plugId = paste.paste_id;
|
|
443
|
-
app.
|
|
444
|
-
|
|
445
|
-
app.keitaroData.
|
|
446
|
-
app.keitaroData.
|
|
447
|
-
app.keitaroData.
|
|
448
|
-
app.keitaroData.
|
|
449
|
-
app.keitaroData.
|
|
450
|
-
app.keitaroData.
|
|
451
|
-
app.keitaroData.
|
|
452
|
-
app.keitaroData.
|
|
453
|
-
app.keitaroData.
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
if (offerIdParameterName)
|
|
457
|
-
|
|
458
|
-
if (
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
console.log(`Redirect: bundle differs (${app.bundle} in DB and ${redirectCampaignName})`);
|
|
465
|
-
}
|
|
435
|
+
app.reservePlugType =
|
|
436
|
+
app.plugAccountId = parseInt(paste.accountId);
|
|
437
|
+
// app.keitaroData.redirectDomainName = redirectDomain || "none"
|
|
438
|
+
// app.keitaroData.redirectDomainId = redirectDomainId || 0
|
|
439
|
+
// app.keitaroData.redirectCampaignId = redirectCampaignId || 0
|
|
440
|
+
// app.keitaroData.redirectCampaignName = redirectCampaignName || "none"
|
|
441
|
+
// app.keitaroData.redirectCampaignAlias = redirectCampaignAlias || "none"
|
|
442
|
+
// app.keitaroData.trackingDomainId = owDomainId || 0
|
|
443
|
+
// app.keitaroData.trackingDomainName = owDomain || "none"
|
|
444
|
+
// app.keitaroData.trackingCampaignId = owCampaignId || 0
|
|
445
|
+
// app.keitaroData.trackingCampaignName = owCampaignName || "none"
|
|
446
|
+
// app.keitaroData.trackingCampaignAlias = owCampaignAlias || "none"
|
|
447
|
+
// if (clickIdParameterName) app.keitaroData.clickIdParameterName = clickIdParameterName
|
|
448
|
+
// if (offerIdParameterName) app.keitaroData.offerIdParameterName = offerIdParameterName
|
|
449
|
+
// if (trackingLink) app.trackingUrl = trackingLink
|
|
450
|
+
// if (!owCampaignName?.includes(app.bundle) && ow) {
|
|
451
|
+
// console.log(`OW: bundle differs (${app.bundle} in DB and ${owCampaignName})`)
|
|
452
|
+
// }
|
|
453
|
+
// if (!redirectCampaignName?.includes(app.bundle) && redirect) {
|
|
454
|
+
// console.log(`Redirect: bundle differs (${app.bundle} in DB and ${redirectCampaignName})`)
|
|
455
|
+
// }
|
|
466
456
|
result.push(app);
|
|
467
457
|
console.log("--------------------");
|
|
468
458
|
}
|
|
@@ -478,4 +468,4 @@ let gatherInfoForFlashApps = async () => {
|
|
|
478
468
|
// changeSourceForFA()
|
|
479
469
|
// addGeosToAllRedirectCampaigns("BE")
|
|
480
470
|
// removeGeosFromAllRedirectCampaigns("BE`")
|
|
481
|
-
|
|
471
|
+
gatherInfoForFlashApps();
|
package/package.json
CHANGED
package/src/flash/flash-app.ts
CHANGED
|
@@ -117,7 +117,7 @@ export const FlashAppSchema = new Schema({
|
|
|
117
117
|
reservePlugType: {
|
|
118
118
|
type: String,
|
|
119
119
|
enum: FlashAppPlugStatus,
|
|
120
|
-
default:
|
|
120
|
+
default: FlashAppPlugStatus.DISABLED,
|
|
121
121
|
required: false
|
|
122
122
|
},
|
|
123
123
|
reservePlugContent: {
|
|
@@ -126,7 +126,7 @@ export const FlashAppSchema = new Schema({
|
|
|
126
126
|
},
|
|
127
127
|
reservePlugStatus: {
|
|
128
128
|
type: String,
|
|
129
|
-
enum:
|
|
129
|
+
enum: FlashAppPlugStatus,
|
|
130
130
|
default: FlashAppPlugStatus.DISABLED,
|
|
131
131
|
required: false
|
|
132
132
|
},
|
|
@@ -401,9 +401,9 @@ let gatherInfoForFlashApps = async () => {
|
|
|
401
401
|
let result = []
|
|
402
402
|
for (let [id, paste] of Object.entries(pasteMap)) {
|
|
403
403
|
console.log(`- #${id}`)
|
|
404
|
-
let ow = owCampaigns[id as keyof object] as IKeitaroCampaign | undefined
|
|
405
|
-
let redirect = redirectCampaigns[id as keyof object] as IKeitaroCampaign | undefined
|
|
406
|
-
let tracking = trackingMap[id as keyof object]
|
|
404
|
+
// let ow = owCampaigns[id as keyof object] as IKeitaroCampaign | undefined
|
|
405
|
+
// let redirect = redirectCampaigns[id as keyof object] as IKeitaroCampaign | undefined
|
|
406
|
+
// let tracking = trackingMap[id as keyof object]
|
|
407
407
|
let app = flashApps[id as keyof object]
|
|
408
408
|
|
|
409
409
|
if (!app) {
|
|
@@ -411,70 +411,71 @@ let gatherInfoForFlashApps = async () => {
|
|
|
411
411
|
continue
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
-
if (paste.status == FlashAppPlugStatus.ENABLED) {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
let appId
|
|
423
|
-
for (let parameter of Object.values(redirect?.parameters || {})) {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
if (!appId && ow) console.log(`No app id for #${id}`)
|
|
429
|
-
else if (appId != id && ow) console.log(`Wrong app id (${appId}) for #${id}`)
|
|
430
|
-
|
|
431
|
-
let owDomain = ow?.domain?.split("/")[2]
|
|
432
|
-
let owDomainId = ow?.domain_id
|
|
433
|
-
let owCampaignId = ow?.id
|
|
434
|
-
let owCampaignName = ow?.name
|
|
435
|
-
let owCampaignAlias = ow?.alias
|
|
436
|
-
let redirectDomain = redirect?.domain?.split("/")[2]
|
|
437
|
-
let redirectDomainId = redirect?.domain_id
|
|
438
|
-
let redirectCampaignId = redirect?.id
|
|
439
|
-
let redirectCampaignName = redirect?.name
|
|
440
|
-
let redirectCampaignAlias = redirect?.alias
|
|
441
|
-
|
|
442
|
-
let clickIdParameterName = ow?.parameters?.sub_id_8?.name
|
|
443
|
-
let offerIdParameterName = ow?.parameters?.sub_id_15?.name
|
|
444
|
-
if (!clickIdParameterName && app && ow) console.log(`No click id parameter for #${id}`)
|
|
445
|
-
if (!offerIdParameterName && app && ow) console.log(`No offer id parameter for #${id}`)
|
|
446
|
-
|
|
447
|
-
let trackingLink = tracking?.trackingUrl
|
|
414
|
+
// if (paste.status == FlashAppPlugStatus.ENABLED) {
|
|
415
|
+
// if (!ow) console.log(`#${id}: no OW`)
|
|
416
|
+
|
|
417
|
+
// if (!redirect) console.log(`No redirect for #${id}`)
|
|
418
|
+
// else if (!paste.content.includes(redirect.domain)) console.log(`#${id}: Redirect domain (${redirect.domain}) differs from paste domain (${paste.content})`)
|
|
419
|
+
// else if (!paste.content.includes(redirect.alias)) console.log(`#${id}: Redirect campaign alias (${redirect.alias}) differs from paste id (${paste.content})`)
|
|
420
|
+
// }
|
|
421
|
+
|
|
422
|
+
// let appId
|
|
423
|
+
// for (let parameter of Object.values(redirect?.parameters || {})) {
|
|
424
|
+
// if (parameter.name == "appId") {
|
|
425
|
+
// appId = parameter.placeholder
|
|
426
|
+
// }
|
|
427
|
+
// }
|
|
428
|
+
// if (!appId && ow) console.log(`No app id for #${id}`)
|
|
429
|
+
// else if (appId != id && ow) console.log(`Wrong app id (${appId}) for #${id}`)
|
|
430
|
+
|
|
431
|
+
// let owDomain = ow?.domain?.split("/")[2]
|
|
432
|
+
// let owDomainId = ow?.domain_id
|
|
433
|
+
// let owCampaignId = ow?.id
|
|
434
|
+
// let owCampaignName = ow?.name
|
|
435
|
+
// let owCampaignAlias = ow?.alias
|
|
436
|
+
// let redirectDomain = redirect?.domain?.split("/")[2]
|
|
437
|
+
// let redirectDomainId = redirect?.domain_id
|
|
438
|
+
// let redirectCampaignId = redirect?.id
|
|
439
|
+
// let redirectCampaignName = redirect?.name
|
|
440
|
+
// let redirectCampaignAlias = redirect?.alias
|
|
441
|
+
|
|
442
|
+
// let clickIdParameterName = ow?.parameters?.sub_id_8?.name
|
|
443
|
+
// let offerIdParameterName = ow?.parameters?.sub_id_15?.name
|
|
444
|
+
// if (!clickIdParameterName && app && ow) console.log(`No click id parameter for #${id}`)
|
|
445
|
+
// if (!offerIdParameterName && app && ow) console.log(`No offer id parameter for #${id}`)
|
|
446
|
+
|
|
447
|
+
// let trackingLink = tracking?.trackingUrl
|
|
448
448
|
|
|
449
449
|
app.plugStatus = paste.status
|
|
450
450
|
app.plugContent = paste.content
|
|
451
451
|
app.plugType = PlugType.PASTEBIN
|
|
452
452
|
app.plugId = paste.paste_id
|
|
453
|
+
app.reservePlugType =
|
|
453
454
|
app.plugAccountId = parseInt(paste.accountId)
|
|
454
455
|
|
|
455
|
-
app.keitaroData.redirectDomainName = redirectDomain || "none"
|
|
456
|
-
app.keitaroData.redirectDomainId = redirectDomainId || 0
|
|
457
|
-
app.keitaroData.redirectCampaignId = redirectCampaignId || 0
|
|
458
|
-
app.keitaroData.redirectCampaignName = redirectCampaignName || "none"
|
|
459
|
-
app.keitaroData.redirectCampaignAlias = redirectCampaignAlias || "none"
|
|
460
|
-
app.keitaroData.trackingDomainId = owDomainId || 0
|
|
461
|
-
app.keitaroData.trackingDomainName = owDomain || "none"
|
|
462
|
-
app.keitaroData.trackingCampaignId = owCampaignId || 0
|
|
463
|
-
app.keitaroData.trackingCampaignName = owCampaignName || "none"
|
|
464
|
-
app.keitaroData.trackingCampaignAlias = owCampaignAlias || "none"
|
|
456
|
+
// app.keitaroData.redirectDomainName = redirectDomain || "none"
|
|
457
|
+
// app.keitaroData.redirectDomainId = redirectDomainId || 0
|
|
458
|
+
// app.keitaroData.redirectCampaignId = redirectCampaignId || 0
|
|
459
|
+
// app.keitaroData.redirectCampaignName = redirectCampaignName || "none"
|
|
460
|
+
// app.keitaroData.redirectCampaignAlias = redirectCampaignAlias || "none"
|
|
461
|
+
// app.keitaroData.trackingDomainId = owDomainId || 0
|
|
462
|
+
// app.keitaroData.trackingDomainName = owDomain || "none"
|
|
463
|
+
// app.keitaroData.trackingCampaignId = owCampaignId || 0
|
|
464
|
+
// app.keitaroData.trackingCampaignName = owCampaignName || "none"
|
|
465
|
+
// app.keitaroData.trackingCampaignAlias = owCampaignAlias || "none"
|
|
465
466
|
|
|
466
|
-
if (clickIdParameterName) app.keitaroData.clickIdParameterName = clickIdParameterName
|
|
467
|
-
if (offerIdParameterName) app.keitaroData.offerIdParameterName = offerIdParameterName
|
|
467
|
+
// if (clickIdParameterName) app.keitaroData.clickIdParameterName = clickIdParameterName
|
|
468
|
+
// if (offerIdParameterName) app.keitaroData.offerIdParameterName = offerIdParameterName
|
|
468
469
|
|
|
469
|
-
if (trackingLink) app.trackingUrl = trackingLink
|
|
470
|
+
// if (trackingLink) app.trackingUrl = trackingLink
|
|
470
471
|
|
|
471
|
-
if (!owCampaignName?.includes(app.bundle) && ow) {
|
|
472
|
-
|
|
473
|
-
}
|
|
472
|
+
// if (!owCampaignName?.includes(app.bundle) && ow) {
|
|
473
|
+
// console.log(`OW: bundle differs (${app.bundle} in DB and ${owCampaignName})`)
|
|
474
|
+
// }
|
|
474
475
|
|
|
475
|
-
if (!redirectCampaignName?.includes(app.bundle) && redirect) {
|
|
476
|
-
|
|
477
|
-
}
|
|
476
|
+
// if (!redirectCampaignName?.includes(app.bundle) && redirect) {
|
|
477
|
+
// console.log(`Redirect: bundle differs (${app.bundle} in DB and ${redirectCampaignName})`)
|
|
478
|
+
// }
|
|
478
479
|
|
|
479
480
|
result.push(app)
|
|
480
481
|
|
|
@@ -497,4 +498,4 @@ let gatherInfoForFlashApps = async () => {
|
|
|
497
498
|
// addGeosToAllRedirectCampaigns("BE")
|
|
498
499
|
// removeGeosFromAllRedirectCampaigns("BE`")
|
|
499
500
|
|
|
500
|
-
|
|
501
|
+
gatherInfoForFlashApps()
|