@bprotsyk/aso-core 1.2.83 → 1.2.86

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.
@@ -63,7 +63,7 @@ exports.FlashAppSchema = new mongoose_1.Schema({
63
63
  reservePlugType: {
64
64
  type: String,
65
65
  enum: FlashAppPlugStatus,
66
- default: PlugType.GIST,
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: PlugType,
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 == flash_app_1.FlashAppPlugStatus.ENABLED) {
403
- if (!ow)
404
- console.log(`#${id}: no OW`);
405
- if (!redirect)
406
- console.log(`No redirect for #${id}`);
407
- else if (!paste.content.includes(redirect.domain))
408
- console.log(`#${id}: Redirect domain (${redirect.domain}) differs from paste domain (${paste.content})`);
409
- else if (!paste.content.includes(redirect.alias))
410
- console.log(`#${id}: Redirect campaign alias (${redirect.alias}) differs from paste id (${paste.content})`);
411
- }
412
- let appId;
413
- for (let parameter of Object.values(redirect?.parameters || {})) {
414
- if (parameter.name == "appId") {
415
- appId = parameter.placeholder;
416
- }
417
- }
418
- if (!appId && ow)
419
- console.log(`No app id for #${id}`);
420
- else if (appId != id && ow)
421
- console.log(`Wrong app id (${appId}) for #${id}`);
422
- let owDomain = ow?.domain?.split("/")[2];
423
- let owDomainId = ow?.domain_id;
424
- let owCampaignId = ow?.id;
425
- let owCampaignName = ow?.name;
426
- let owCampaignAlias = ow?.alias;
427
- let redirectDomain = redirect?.domain?.split("/")[2];
428
- let redirectDomainId = redirect?.domain_id;
429
- let redirectCampaignId = redirect?.id;
430
- let redirectCampaignName = redirect?.name;
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;
435
+ app.reservePlugType = flash_app_1.PlugType.PASTEBIN;
443
436
  app.plugAccountId = parseInt(paste.accountId);
444
- app.keitaroData.redirectDomainName = redirectDomain || "none";
445
- app.keitaroData.redirectDomainId = redirectDomainId || 0;
446
- app.keitaroData.redirectCampaignId = redirectCampaignId || 0;
447
- app.keitaroData.redirectCampaignName = redirectCampaignName || "none";
448
- app.keitaroData.redirectCampaignAlias = redirectCampaignAlias || "none";
449
- app.keitaroData.trackingDomainId = owDomainId || 0;
450
- app.keitaroData.trackingDomainName = owDomain || "none";
451
- app.keitaroData.trackingCampaignId = owCampaignId || 0;
452
- app.keitaroData.trackingCampaignName = owCampaignName || "none";
453
- app.keitaroData.trackingCampaignAlias = owCampaignAlias || "none";
454
- if (clickIdParameterName)
455
- app.keitaroData.clickIdParameterName = clickIdParameterName;
456
- if (offerIdParameterName)
457
- app.keitaroData.offerIdParameterName = offerIdParameterName;
458
- if (trackingLink)
459
- app.trackingUrl = trackingLink;
460
- if (!owCampaignName?.includes(app.bundle) && ow) {
461
- console.log(`OW: bundle differs (${app.bundle} in DB and ${owCampaignName})`);
462
- }
463
- if (!redirectCampaignName?.includes(app.bundle) && redirect) {
464
- console.log(`Redirect: bundle differs (${app.bundle} in DB and ${redirectCampaignName})`);
465
- }
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "1.2.83",
3
+ "version": "1.2.86",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -117,7 +117,7 @@ export const FlashAppSchema = new Schema({
117
117
  reservePlugType: {
118
118
  type: String,
119
119
  enum: FlashAppPlugStatus,
120
- default: PlugType.GIST,
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: PlugType,
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
- 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
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 = PlugType.PASTEBIN
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"
465
-
466
- if (clickIdParameterName) app.keitaroData.clickIdParameterName = clickIdParameterName
467
- if (offerIdParameterName) app.keitaroData.offerIdParameterName = offerIdParameterName
468
-
469
- if (trackingLink) app.trackingUrl = trackingLink
470
-
471
- if (!owCampaignName?.includes(app.bundle) && ow) {
472
- console.log(`OW: bundle differs (${app.bundle} in DB and ${owCampaignName})`)
473
- }
474
-
475
- if (!redirectCampaignName?.includes(app.bundle) && redirect) {
476
- console.log(`Redirect: bundle differs (${app.bundle} in DB and ${redirectCampaignName})`)
477
- }
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"
466
+
467
+ // if (clickIdParameterName) app.keitaroData.clickIdParameterName = clickIdParameterName
468
+ // if (offerIdParameterName) app.keitaroData.offerIdParameterName = offerIdParameterName
469
+
470
+ // if (trackingLink) app.trackingUrl = trackingLink
471
+
472
+ // if (!owCampaignName?.includes(app.bundle) && ow) {
473
+ // console.log(`OW: bundle differs (${app.bundle} in DB and ${owCampaignName})`)
474
+ // }
475
+
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