@bprotsyk/aso-core 1.2.236 → 1.2.237
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/README.md +1 -1
- package/docs/assets/highlight.css +22 -22
- package/docs/assets/main.js +58 -58
- package/docs/assets/style.css +1279 -1279
- package/docs/enums/PanelUserAccessScope.html +126 -126
- package/docs/functions/ASO_v0.toDefault.html +80 -80
- package/docs/functions/ASO_v1.toDefault.html +80 -80
- package/docs/functions/ASO_v2.toDefault.html +78 -78
- package/docs/functions/ASO_v3.toDefault.html +77 -77
- package/docs/functions/ASO_v4.toDefault.html +75 -75
- package/docs/functions/ASO_v5.toDefault.html +76 -76
- package/docs/functions/ColoredText.html +92 -92
- package/docs/functions/ShapeDiv.html +109 -109
- package/docs/index.html +82 -82
- package/docs/interfaces/ASOConfigFetch.IUsageLogEntry.html +1413 -1413
- package/docs/interfaces/ASOConfigFetch.IUsageLogRequest.html +103 -103
- package/docs/interfaces/ASOConfigFetch.IUsageLogResponse.html +108 -108
- package/docs/interfaces/ASO_v0.IAuthorizationActionMapping.html +145 -145
- package/docs/interfaces/ASO_v0.IColoredSpan.html +89 -89
- package/docs/interfaces/ASO_v0.IColoredSpanMapping.html +89 -89
- package/docs/interfaces/ASO_v0.IColoredString.html +89 -89
- package/docs/interfaces/ASO_v0.IColoredStringMapping.html +89 -89
- package/docs/interfaces/ASO_v0.IConfig.html +556 -556
- package/docs/interfaces/ASO_v0.IConfigMapping.html +229 -229
- package/docs/interfaces/ASO_v0.ILocalization.html +516 -516
- package/docs/interfaces/ASO_v0.ILocalizationMap.html +77 -77
- package/docs/interfaces/ASO_v0.ILocalizationMapping.html +502 -502
- package/docs/interfaces/ASO_v0.IOfferResult.html +103 -103
- package/docs/interfaces/ASO_v0.IOfferResultEmoji.html +82 -82
- package/docs/interfaces/ASO_v0.IOfferResultMapping.html +117 -117
- package/docs/interfaces/ASO_v0.IOfferSectionMapping.html +108 -108
- package/docs/interfaces/ASO_v0.IOffersSection.html +96 -96
- package/docs/interfaces/ASO_v0.ISectionPalette.html +152 -152
- package/docs/interfaces/ASO_v0.ISectionPaletteMapping.html +152 -152
- package/docs/interfaces/ASO_v1.IAuthorizationActionMapping.html +145 -145
- package/docs/interfaces/ASO_v1.IColoredSpan.html +89 -89
- package/docs/interfaces/ASO_v1.IColoredSpanMapping.html +89 -89
- package/docs/interfaces/ASO_v1.IColoredString.html +89 -89
- package/docs/interfaces/ASO_v1.IColoredStringMapping.html +89 -89
- package/docs/interfaces/ASO_v1.IConfig.html +549 -549
- package/docs/interfaces/ASO_v1.IConfigMapping.html +229 -229
- package/docs/interfaces/ASO_v1.ILocalization.html +481 -481
- package/docs/interfaces/ASO_v1.ILocalizationMap.html +77 -77
- package/docs/interfaces/ASO_v1.ILocalizationMapping.html +481 -481
- package/docs/interfaces/ASO_v1.IOfferResult.html +103 -103
- package/docs/interfaces/ASO_v1.IOfferResultEmoji.html +82 -82
- package/docs/interfaces/ASO_v1.IOfferResultMapping.html +117 -117
- package/docs/interfaces/ASO_v1.IOfferSectionMapping.html +108 -108
- package/docs/interfaces/ASO_v1.IOffersSection.html +101 -101
- package/docs/interfaces/ASO_v1.ISectionPalette.html +152 -152
- package/docs/interfaces/ASO_v1.ISectionPaletteMapping.html +152 -152
- package/docs/interfaces/ASO_v2.IAuthorizationActionMapping.html +138 -138
- package/docs/interfaces/ASO_v2.IColoredSpanMapping.html +89 -89
- package/docs/interfaces/ASO_v2.IColoredString.html +89 -89
- package/docs/interfaces/ASO_v2.IColoredStringMapping.html +89 -89
- package/docs/interfaces/ASO_v2.IConfig.html +493 -493
- package/docs/interfaces/ASO_v2.IConfigMapping.html +201 -201
- package/docs/interfaces/ASO_v2.ILocalization.html +474 -474
- package/docs/interfaces/ASO_v2.ILocalizationMap.html +75 -75
- package/docs/interfaces/ASO_v2.ILocalizationMapping.html +362 -362
- package/docs/interfaces/ASO_v2.IOfferResult.html +110 -110
- package/docs/interfaces/ASO_v2.IOfferResultMapping.html +117 -117
- package/docs/interfaces/ASO_v2.IOfferSectionMapping.html +108 -108
- package/docs/interfaces/ASO_v2.IOffersSection.html +101 -101
- package/docs/interfaces/ASO_v2.ISectionPalette.html +152 -152
- package/docs/interfaces/ASO_v2.ISectionPaletteMapping.html +152 -152
- package/docs/interfaces/ASO_v3.IAuthorizationActionMapping.html +138 -138
- package/docs/interfaces/ASO_v3.IColoredSpanMapping.html +89 -89
- package/docs/interfaces/ASO_v3.IColoredString.html +89 -89
- package/docs/interfaces/ASO_v3.IColoredStringMapping.html +89 -89
- package/docs/interfaces/ASO_v3.IConfig.html +514 -514
- package/docs/interfaces/ASO_v3.IConfigMapping.html +208 -208
- package/docs/interfaces/ASO_v3.ILocalization.html +446 -446
- package/docs/interfaces/ASO_v3.ILocalizationMap.html +74 -74
- package/docs/interfaces/ASO_v3.ILocalizationMapping.html +341 -341
- package/docs/interfaces/ASO_v3.IOfferResultMapping.html +117 -117
- package/docs/interfaces/ASO_v3.IOfferSectionMapping.html +108 -108
- package/docs/interfaces/ASO_v3.IOffersSection.html +101 -101
- package/docs/interfaces/ASO_v3.ISectionPalette.html +152 -152
- package/docs/interfaces/ASO_v3.ISectionPaletteMapping.html +152 -152
- package/docs/interfaces/ASO_v4.IAuthorizationActionMapping.html +138 -138
- package/docs/interfaces/ASO_v4.IColoredSpanMapping.html +89 -89
- package/docs/interfaces/ASO_v4.IColoredString.html +89 -89
- package/docs/interfaces/ASO_v4.IColoredStringMapping.html +89 -89
- package/docs/interfaces/ASO_v4.IConfig.html +514 -514
- package/docs/interfaces/ASO_v4.IConfigMapping.html +131 -131
- package/docs/interfaces/ASO_v4.ILocalization.html +369 -369
- package/docs/interfaces/ASO_v4.ILocalizationMap.html +72 -72
- package/docs/interfaces/ASO_v4.ILocalizationMapping.html +257 -257
- package/docs/interfaces/ASO_v4.IOfferResultMapping.html +117 -117
- package/docs/interfaces/ASO_v4.IOfferSectionMapping.html +89 -89
- package/docs/interfaces/ASO_v4.LocalizedString.html +82 -82
- package/docs/interfaces/ASO_v5.IAuthorizationActionMapping.html +138 -138
- package/docs/interfaces/ASO_v5.IColoredSpan.html +89 -89
- package/docs/interfaces/ASO_v5.IColoredSpanMapping.html +89 -89
- package/docs/interfaces/ASO_v5.IColoredString.html +89 -89
- package/docs/interfaces/ASO_v5.IColoredStringMapping.html +89 -89
- package/docs/interfaces/ASO_v5.IConfig.html +542 -542
- package/docs/interfaces/ASO_v5.IConfigMapping.html +159 -159
- package/docs/interfaces/ASO_v5.ILocalization.html +411 -411
- package/docs/interfaces/ASO_v5.ILocalizationMap.html +73 -73
- package/docs/interfaces/ASO_v5.ILocalizationMapping.html +299 -299
- package/docs/interfaces/ASO_v5.IOfferResultMapping.html +117 -117
- package/docs/interfaces/ASO_v5.IOfferSectionMapping.html +89 -89
- package/docs/interfaces/ASO_v5.LocalizedString.html +82 -82
- package/docs/interfaces/IAsoConfigResponse.html +81 -81
- package/docs/interfaces/IAsoCustomizedOffer.html +116 -116
- package/docs/interfaces/IAsoDefaultConfig.html +443 -443
- package/docs/interfaces/IAsoOfferResponse.html +81 -81
- package/docs/interfaces/IAsoSection.html +88 -88
- package/docs/interfaces/IAsoSingleOffer.html +88 -88
- package/docs/interfaces/IAuthToken.html +102 -102
- package/docs/interfaces/IColoredTextProps.html +74 -74
- package/docs/interfaces/IFlashApp.html +144 -144
- package/docs/interfaces/IFlashAppListItem.html +88 -88
- package/docs/interfaces/IGradient.html +95 -95
- package/docs/interfaces/IOffer.html +137 -137
- package/docs/interfaces/IOfferWallAuthConfig.html +130 -130
- package/docs/interfaces/IOfferWallAuthLocalization.html +102 -102
- package/docs/interfaces/IOfferWallAuthSubmitRequest.html +74 -74
- package/docs/interfaces/IOfferWallAuthSubmitResponse.html +74 -74
- package/docs/interfaces/IOfferWallHomeDialogData.html +95 -95
- package/docs/interfaces/IOfferWallOffer.html +109 -109
- package/docs/interfaces/IOfferWallResponse.html +81 -81
- package/docs/interfaces/IOfferWallSection.html +88 -88
- package/docs/interfaces/IPanelUser.html +1405 -1405
- package/docs/interfaces/IPush.html +95 -95
- package/docs/interfaces/IShape.html +102 -102
- package/docs/interfaces/IStroke.html +81 -81
- package/docs/interfaces/IUpsertFlashAppRequest.html +214 -214
- package/docs/interfaces/IUpsertFlashAppResponse.html +81 -81
- package/docs/modules/ASOConfigFetch.html +63 -63
- package/docs/modules/ASO_v0.html +96 -96
- package/docs/modules/ASO_v1.html +96 -96
- package/docs/modules/ASO_v2.html +92 -92
- package/docs/modules/ASO_v3.html +90 -90
- package/docs/modules/ASO_v4.html +86 -86
- package/docs/modules/ASO_v5.html +88 -88
- package/docs/modules.html +133 -133
- package/docs/variables/FlashAppSchema.html +83 -83
- package/docs/variables/PanelUserSchema.html +83 -83
- package/lib/app/app-integration.d.ts +53 -53
- package/lib/app/app-integration.js +63 -63
- package/lib/app/app-list-item.d.ts +5 -5
- package/lib/app/app-list-item.js +2 -2
- package/lib/app/app-type.d.ts +4 -4
- package/lib/app/app-type.js +8 -8
- package/lib/app/app.d.ts +177 -178
- package/lib/app/app.js +216 -216
- package/lib/aso/config/aso-config-v0.d.ts +333 -0
- package/lib/aso/config/aso-config-v0.js +59 -0
- package/lib/aso/config/aso-config-v1.d.ts +330 -0
- package/lib/aso/config/aso-config-v1.js +58 -0
- package/lib/aso/config/aso-config-v2.d.ts +297 -0
- package/lib/aso/config/aso-config-v2.js +57 -0
- package/lib/aso/config/aso-config-v3.d.ts +294 -0
- package/lib/aso/config/aso-config-v3.js +58 -0
- package/lib/aso/config/aso-config-v4.d.ts +208 -0
- package/lib/aso/config/aso-config-v4.js +58 -0
- package/lib/aso/config/aso-config-v5.d.ts +227 -0
- package/lib/aso/config/aso-config-v5.js +58 -0
- package/lib/aso/config/aso-default-config.d.ts +57 -0
- package/lib/aso/config/aso-default-config.js +2 -0
- package/lib/aso/config/aso-single-response.d.ts +5 -0
- package/lib/aso/config/aso-single-response.js +2 -0
- package/lib/aso/offer/aso-customized-offer.d.ts +11 -0
- package/lib/aso/offer/aso-customized-offer.js +2 -0
- package/lib/aso/offer/aso-offer-response.d.ts +6 -0
- package/lib/aso/offer/aso-offer-response.js +2 -0
- package/lib/aso/offer/aso-offer-section.d.ts +6 -0
- package/lib/aso/offer/aso-offer-section.js +2 -0
- package/lib/aso/offer/aso-single-offer.d.ts +5 -0
- package/lib/aso/offer/aso-single-offer.js +2 -0
- package/lib/aso/offer/config/aso-config-v0.d.ts +271 -0
- package/lib/aso/offer/config/aso-config-v0.js +57 -0
- package/lib/aso/offer/config/aso-config-v1.d.ts +263 -0
- package/lib/aso/offer/config/aso-config-v1.js +57 -0
- package/lib/aso/offer/config/aso-config-v2.d.ts +230 -0
- package/lib/aso/offer/config/aso-config-v2.js +55 -0
- package/lib/aso/offer/config/aso-config-v3.d.ts +227 -0
- package/lib/aso/offer/config/aso-config-v3.js +56 -0
- package/lib/aso/offer/config/aso-config-v4.d.ts +205 -0
- package/lib/aso/offer/config/aso-config-v4.js +56 -0
- package/lib/aso/offer/config/aso-default-config.d.ts +56 -0
- package/lib/aso/offer/config/aso-default-config.js +2 -0
- package/lib/aso/offer/config/aso-single-response.d.ts +5 -0
- package/lib/aso/offer/config/aso-single-response.js +2 -0
- package/lib/aso/offerwall/auth/offerwall-auth-config.d.ts +14 -0
- package/lib/aso/offerwall/auth/offerwall-auth-config.js +2 -0
- package/lib/aso/offerwall/auth/offerwall-auth-localization.d.ts +8 -0
- package/lib/aso/offerwall/auth/offerwall-auth-localization.js +2 -0
- package/lib/aso/offerwall/auth/offerwall-auth-submit-request.d.ts +3 -0
- package/lib/aso/offerwall/auth/offerwall-auth-submit-request.js +2 -0
- package/lib/aso/offerwall/auth/offerwall-auth-submit-response.d.ts +3 -0
- package/lib/aso/offerwall/auth/offerwall-auth-submit-response.js +2 -0
- package/lib/aso/offerwall/offerwall-home-dialog-data.d.ts +6 -0
- package/lib/aso/offerwall/offerwall-home-dialog-data.js +2 -0
- package/lib/aso/offerwall/offerwall-offer.d.ts +8 -0
- package/lib/aso/offerwall/offerwall-offer.js +2 -0
- package/lib/aso/offerwall/offerwall-response.d.ts +6 -0
- package/lib/aso/offerwall/offerwall-response.js +2 -0
- package/lib/aso/offerwall/offerwall-section.d.ts +6 -0
- package/lib/aso/offerwall/offerwall-section.js +2 -0
- package/lib/aso/usage-logs/aso-config-fetch-entry.d.ts +28 -0
- package/lib/aso/usage-logs/aso-config-fetch-entry.js +2 -0
- package/lib/flash/flash-app-integration.d.ts +53 -0
- package/lib/flash/flash-app-integration.js +63 -0
- package/lib/flash/flash-app-list-item.d.ts +5 -0
- package/lib/flash/flash-app-list-item.js +2 -0
- package/lib/flash/flash-app-type.d.ts +4 -0
- package/lib/flash/flash-app-type.js +8 -0
- package/lib/flash/flash-app.d.ts +169 -0
- package/lib/flash/flash-app.js +215 -0
- package/lib/general/cloudflare-domain.d.ts +42 -42
- package/lib/general/cloudflare-domain.js +12 -12
- package/lib/general/colored-text.d.ts +7 -7
- package/lib/general/colored-text.js +28 -28
- package/lib/general/domain.d.ts +92 -92
- package/lib/general/domain.js +38 -38
- package/lib/general/namecheap-domain.d.ts +79 -80
- package/lib/general/namecheap-domain.js +14 -14
- package/lib/general/push.d.ts +6 -6
- package/lib/general/push.js +2 -2
- package/lib/general/queue.d.ts +1 -2
- package/lib/general/queue.js +2 -1
- package/lib/general/shape.d.ts +18 -18
- package/lib/general/shape.js +36 -33
- package/lib/index.d.ts +25 -25
- package/lib/index.js +65 -42
- package/lib/keitaro/keitaro-campaign.d.ts +31 -31
- package/lib/keitaro/keitaro-campaign.js +5 -5
- package/lib/keitaro/keitaro-domain.d.ts +6 -6
- package/lib/keitaro/keitaro-domain.js +2 -2
- package/lib/keitaro/keitaro-offer.d.ts +7 -7
- package/lib/keitaro/keitaro-offer.js +2 -2
- package/lib/keitaro/keitaro-stream.d.ts +20 -20
- package/lib/keitaro/keitaro-stream.js +2 -2
- package/lib/models/cloudflare-domain.d.ts +42 -42
- package/lib/models/cloudflare-domain.js +12 -12
- package/lib/models/domain.d.ts +92 -92
- package/lib/models/domain.js +38 -38
- package/lib/models/namecheap-domain.d.ts +80 -80
- package/lib/models/namecheap-domain.js +14 -14
- package/lib/network/keitaro/http.d.ts +3 -2
- package/lib/network/keitaro/http.js +12 -9
- package/lib/network/keitaro/keitaro-service.d.ts +50 -50
- package/lib/network/keitaro/keitaro-service.js +260 -257
- package/lib/offers/list.d.ts +37 -37
- package/lib/offers/list.js +12 -12
- package/lib/offers/offer.d.ts +91 -91
- package/lib/offers/offer.js +42 -42
- package/lib/offers/offerwall/offerwall-home-dialog-data.d.ts +6 -6
- package/lib/offers/offerwall/offerwall-home-dialog-data.js +2 -2
- package/lib/offers/offerwall/offerwall-offer.d.ts +12 -12
- package/lib/offers/offerwall/offerwall-offer.js +2 -2
- package/lib/offers/offerwall/offerwall-response.d.ts +6 -6
- package/lib/offers/offerwall/offerwall-response.js +2 -2
- package/lib/offers/offerwall/offerwall-section.d.ts +6 -6
- package/lib/offers/offerwall/offerwall-section.js +2 -2
- package/lib/offers/section.d.ts +47 -47
- package/lib/offers/section.js +20 -20
- package/lib/panel/auth.d.ts +8 -8
- package/lib/panel/auth.js +2 -2
- package/lib/panel/flash/create-flash-app-request.d.ts +28 -28
- package/lib/panel/flash/create-flash-app-request.js +2 -2
- package/lib/panel/flash/upsert-flash-app-request.d.ts +27 -27
- package/lib/panel/flash/upsert-flash-app-request.js +2 -2
- package/lib/panel/user.d.ts +46 -46
- package/lib/panel/user.js +28 -28
- package/lib/shared/colored-text.d.ts +7 -7
- package/lib/shared/colored-text.js +28 -28
- package/lib/shared/offer.d.ts +12 -12
- package/lib/shared/offer.js +2 -2
- package/lib/shared/push.d.ts +6 -6
- package/lib/shared/push.js +2 -2
- package/lib/shared/queue.d.ts +1 -1
- package/lib/shared/queue.js +2 -2
- package/lib/shared/shape.d.ts +18 -18
- package/lib/shared/shape.js +36 -36
- package/lib/shared/single-offer.d.ts +5 -5
- package/lib/shared/single-offer.js +2 -2
- package/lib/utils/app-gathering-utils.d.ts +15 -15
- package/lib/utils/app-gathering-utils.js +2 -2
- package/lib/utils/general.d.ts +11 -11
- package/lib/utils/general.js +40 -40
- package/lib/utils/huawei/converter.d.ts +2 -2
- package/lib/utils/huawei/converter.js +53 -53
- package/lib/utils/keitaro-utils.d.ts +15 -15
- package/lib/utils/keitaro-utils.js +544 -541
- package/lib/utils/server-util.d.ts +26 -19
- package/lib/utils/server-util.js +176 -115
- package/package.json +46 -46
- package/src/app/app-integration.ts +66 -66
- package/src/app/app-list-item.ts +4 -4
- package/src/app/app-type.ts +3 -3
- package/src/app/app.ts +353 -353
- package/src/general/cloudflare-domain.ts +44 -44
- package/src/general/domain.ts +75 -75
- package/src/general/namecheap-domain.ts +56 -56
- package/src/general/push.ts +5 -5
- package/src/general/queue.ts +4 -4
- package/src/general/shape.tsx +55 -55
- package/src/index.ts +33 -32
- package/src/keitaro/keitaro-campaign.ts +35 -35
- package/src/keitaro/keitaro-domain.ts +5 -5
- package/src/keitaro/keitaro-offer.ts +6 -6
- package/src/keitaro/keitaro-stream.ts +19 -19
- package/src/network/keitaro/http.ts +8 -8
- package/src/network/keitaro/keitaro-service.ts +322 -322
- package/src/offers/list.ts +19 -19
- package/src/offers/offer.ts +80 -80
- package/src/offers/offerwall/offerwall-home-dialog-data.ts +6 -6
- package/src/offers/offerwall/offerwall-offer.ts +12 -12
- package/src/offers/offerwall/offerwall-response.ts +7 -7
- package/src/offers/offerwall/offerwall-section.ts +7 -7
- package/src/offers/section.ts +29 -29
- package/src/panel/auth.ts +8 -8
- package/src/panel/flash/upsert-flash-app-request.ts +37 -37
- package/src/panel/user.ts +38 -38
- package/src/templates/nginx-template.conf +35 -0
- package/src/types/ssh2-sftp-client.d.ts +59 -0
- package/src/utils/data.csv +65 -65
- package/src/utils/general.ts +36 -36
- package/src/utils/huawei/converter.ts +55 -55
- package/src/utils/keitaro-utils.ts +626 -626
- package/src/utils/map-apps.json +4747 -4747
- package/src/utils/server-util.ts +246 -123
- package/src/utils/update-postbacks.js +27 -27
- package/tsconfig.json +17 -16
|
@@ -1,541 +1,544 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
// let
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
// let
|
|
106
|
-
//
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
let
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (!
|
|
141
|
-
continue;
|
|
142
|
-
let
|
|
143
|
-
geos
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
let
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
"
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
"
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
"
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
"
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
"
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
"
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
"
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
"
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
"
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
"
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
"
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
"
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
"
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
"
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
//
|
|
424
|
-
//
|
|
425
|
-
//
|
|
426
|
-
//
|
|
427
|
-
//
|
|
428
|
-
// let
|
|
429
|
-
//
|
|
430
|
-
//
|
|
431
|
-
//
|
|
432
|
-
//
|
|
433
|
-
//
|
|
434
|
-
// let
|
|
435
|
-
//
|
|
436
|
-
//
|
|
437
|
-
//
|
|
438
|
-
//
|
|
439
|
-
//
|
|
440
|
-
//
|
|
441
|
-
//
|
|
442
|
-
// //
|
|
443
|
-
// //
|
|
444
|
-
// // }
|
|
445
|
-
// //
|
|
446
|
-
// //
|
|
447
|
-
// //
|
|
448
|
-
// //
|
|
449
|
-
// //
|
|
450
|
-
// //
|
|
451
|
-
// //
|
|
452
|
-
// //
|
|
453
|
-
// //
|
|
454
|
-
// //
|
|
455
|
-
// //
|
|
456
|
-
// // let
|
|
457
|
-
// // let
|
|
458
|
-
// // let
|
|
459
|
-
// // let
|
|
460
|
-
// // let
|
|
461
|
-
// // let
|
|
462
|
-
// // let
|
|
463
|
-
// // let
|
|
464
|
-
// // let
|
|
465
|
-
// //
|
|
466
|
-
// //
|
|
467
|
-
// // let
|
|
468
|
-
// // app.
|
|
469
|
-
// // app.
|
|
470
|
-
// //
|
|
471
|
-
// // app.
|
|
472
|
-
// // app.
|
|
473
|
-
// // app.
|
|
474
|
-
// // app.
|
|
475
|
-
// // app.
|
|
476
|
-
// // app.
|
|
477
|
-
// // app.keitaroData.
|
|
478
|
-
// // app.keitaroData.
|
|
479
|
-
// // app.keitaroData.
|
|
480
|
-
// // app.keitaroData.
|
|
481
|
-
// // app.keitaroData.
|
|
482
|
-
// // app.keitaroData.
|
|
483
|
-
// // app.keitaroData.
|
|
484
|
-
// //
|
|
485
|
-
// //
|
|
486
|
-
// //
|
|
487
|
-
// // if (
|
|
488
|
-
// //
|
|
489
|
-
// //
|
|
490
|
-
// // if (!
|
|
491
|
-
// // console.log(`
|
|
492
|
-
// // }
|
|
493
|
-
//
|
|
494
|
-
// console.log(
|
|
495
|
-
//
|
|
496
|
-
//
|
|
497
|
-
//
|
|
498
|
-
//
|
|
499
|
-
//
|
|
500
|
-
//
|
|
501
|
-
//
|
|
502
|
-
//
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
if (
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
//
|
|
529
|
-
//
|
|
530
|
-
//
|
|
531
|
-
//
|
|
532
|
-
//
|
|
533
|
-
//
|
|
534
|
-
//
|
|
535
|
-
//
|
|
536
|
-
//
|
|
537
|
-
//
|
|
538
|
-
//
|
|
539
|
-
//
|
|
540
|
-
//
|
|
541
|
-
//
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createOWCampaign = exports.createDirectCampaign = exports.createFlashCampaigns = exports.createOWStreamPartialPayload = exports.prepareOWCampaignParameters = exports.createOrFindFlashRedirectCampaign = exports.removeGeosFromAllRedirectCampaigns = exports.addGeosToAllRedirectCampaigns = exports.TRAFFIC_SOURCE_ID_FLASH_AI = void 0;
|
|
7
|
+
const keitaro_service_1 = require("../network/keitaro/keitaro-service");
|
|
8
|
+
const sleep_promise_1 = __importDefault(require("sleep-promise"));
|
|
9
|
+
const FLASH_REDIRECT_GROUP_ID = 82;
|
|
10
|
+
exports.TRAFFIC_SOURCE_ID_FLASH_AI = 22;
|
|
11
|
+
const UNIQUENESS_METHOD = "ip_ua";
|
|
12
|
+
const MAX_COOKIES_TTL = 8760;
|
|
13
|
+
const TYPE_POSITION = "position";
|
|
14
|
+
const STATE_ACTIVE = "active";
|
|
15
|
+
const COST_TYPE_CPC = "CPC";
|
|
16
|
+
const COST_VALUE = 0;
|
|
17
|
+
const COST_CURRENCY_USD = "USD";
|
|
18
|
+
// clear campaigns from unused / wrong streams
|
|
19
|
+
// let sampleApp: IFlashApp = {
|
|
20
|
+
// id: 96,
|
|
21
|
+
// bundle: "com.dynastyof.desert",
|
|
22
|
+
// name: "Room of Fortuna",
|
|
23
|
+
// plugId: "https://pastebin.com/raw/AR2u7dSD",
|
|
24
|
+
// plugType: PlugType.PASTEBIN,
|
|
25
|
+
// plugContent: "",
|
|
26
|
+
// plugStatus: FlashAppPlugStatus.DISABLED,
|
|
27
|
+
// plugAccountId: 1,
|
|
28
|
+
// reservePlugId: "none",
|
|
29
|
+
// reservePlugType: PlugType.OTHER,
|
|
30
|
+
// reservePlugContent: "",
|
|
31
|
+
// reservePlugStatus: FlashAppPlugStatus.DISABLED,
|
|
32
|
+
// reservePlugAccountId: 1,
|
|
33
|
+
// type: FlashAppType.GAMBLING,
|
|
34
|
+
// developerEmail: "bolly.dreams@yahoo.com",
|
|
35
|
+
// developerName: "Serhii Bolsky",
|
|
36
|
+
// developerOrganization: "S.I.B FOP",
|
|
37
|
+
// onesignalAppId: "e66658af-91c3-44bc-8123-ec64b1969cbd",
|
|
38
|
+
// onesignalRestApiKey: "MDk2NjZlNTMtMzBhYi00MjEzLTg0ZGItOWVmZWZhMTczMzI0",
|
|
39
|
+
// generationOptions: {
|
|
40
|
+
// splashActivityClassName: "SplashActivity",
|
|
41
|
+
// mainActivityClassName: "YourActivity",
|
|
42
|
+
// linkName: "likn",
|
|
43
|
+
// savedName: "isOk",
|
|
44
|
+
// paranoidSeed: 228143750
|
|
45
|
+
// },
|
|
46
|
+
// geos: "RU,UA,KZ,ES,BR,PT,CL,MX",
|
|
47
|
+
// keitaroData: {
|
|
48
|
+
// redirectCampaignId: 0,
|
|
49
|
+
// redirectCampaignName: "",
|
|
50
|
+
// redirectDomainId: 0,
|
|
51
|
+
// redirectDomainName: "",
|
|
52
|
+
// trackingCampaignId: 0,
|
|
53
|
+
// trackingCampaignName: "",
|
|
54
|
+
// trackingDomainId: 0,
|
|
55
|
+
// trackingDomainName: "",
|
|
56
|
+
// clickIdParameterName: "p",
|
|
57
|
+
// offerIdParameterName: "i",
|
|
58
|
+
// }
|
|
59
|
+
// } as IFlashApp
|
|
60
|
+
let addGeosToAllRedirectCampaigns = async (geosToAdd) => {
|
|
61
|
+
let allCampaigns = await keitaro_service_1.KeitaroService.getAllCampaigns();
|
|
62
|
+
let regexp = new RegExp(`^F #`);
|
|
63
|
+
const matchingCampaigns = allCampaigns.filter(campaign => regexp.exec(campaign.name));
|
|
64
|
+
for (let campaign of matchingCampaigns) {
|
|
65
|
+
console.log(campaign.name);
|
|
66
|
+
console.log("––––––––––––––––––––––––");
|
|
67
|
+
let streams = await keitaro_service_1.KeitaroService.getStreamsByCampaignId(campaign.id);
|
|
68
|
+
let botStream = streams[0];
|
|
69
|
+
botStream.name = "Bot Protection";
|
|
70
|
+
let owStream = streams.find(s => s.name == "OW");
|
|
71
|
+
for (let stream of [owStream, botStream]) {
|
|
72
|
+
if (!stream)
|
|
73
|
+
continue;
|
|
74
|
+
console.log({
|
|
75
|
+
name: stream.name,
|
|
76
|
+
});
|
|
77
|
+
let geos = stream?.filters[stream.type == "forced" ? 1 : 0]?.payload;
|
|
78
|
+
if (!geos)
|
|
79
|
+
continue;
|
|
80
|
+
geosToAdd.split(" ").forEach((geo) => {
|
|
81
|
+
let streamForGeo = streams.find((s) => s.name == geo);
|
|
82
|
+
if (streamForGeo && stream)
|
|
83
|
+
return;
|
|
84
|
+
if (!geos.includes(geo))
|
|
85
|
+
geos.push(geo);
|
|
86
|
+
});
|
|
87
|
+
stream.filters[stream.type == "forced" ? 1 : 0].payload = geos;
|
|
88
|
+
await keitaro_service_1.KeitaroService.upsertStreamToCampaign(campaign, stream);
|
|
89
|
+
await (0, sleep_promise_1.default)(2000);
|
|
90
|
+
}
|
|
91
|
+
console.log("––––––––––––––––––––––––");
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.addGeosToAllRedirectCampaigns = addGeosToAllRedirectCampaigns;
|
|
95
|
+
// export let changeTrackingOfferGeo = async (appId: number, keitaroId: string, geo: string) => {
|
|
96
|
+
// let allCampaigns = await KeitaroService.getAllCampaigns()
|
|
97
|
+
// let regexp = new RegExp(`^FA #${appId} `)
|
|
98
|
+
// let matchingCampaign = allCampaigns.find(campaign => regexp.exec(campaign.name))
|
|
99
|
+
// if (!matchingCampaign) throw new Error(`No matching campaign got appId ${appId}`)
|
|
100
|
+
// let streams = await KeitaroService.getStreamsByCampaignId(matchingCampaign.id)
|
|
101
|
+
// letstream =
|
|
102
|
+
// for (let campaign of matchingCampaigns) {
|
|
103
|
+
// console.log(campaign.name)
|
|
104
|
+
// console.log("––––––––––––––––––––––––")
|
|
105
|
+
// let streams = await KeitaroService.getStreamsByCampaignId(campaign.id)
|
|
106
|
+
// let botStream = streams[0]
|
|
107
|
+
// botStream.name = "Bot Protection"
|
|
108
|
+
// let owStream = streams.find(s => s.name == "OW")
|
|
109
|
+
// for (let stream of [owStream, botStream]) {
|
|
110
|
+
// if (!stream) continue
|
|
111
|
+
// console.log({
|
|
112
|
+
// name: stream.name,
|
|
113
|
+
// })
|
|
114
|
+
// let geos = stream?.filters[stream.type == "forced" ? 1 : 0]?.payload
|
|
115
|
+
// if (!geos) continue
|
|
116
|
+
// geosToAdd.split(" ").forEach((geo: string) => {
|
|
117
|
+
// let streamForGeo = streams.find((s) => s.name == geo)
|
|
118
|
+
// if (streamForGeo && stream) return
|
|
119
|
+
// if (!geos.includes(geo)) geos.push(geo)
|
|
120
|
+
// });
|
|
121
|
+
// stream.filters[stream.type == "forced" ? 1 : 0].payload = geos
|
|
122
|
+
// await KeitaroService.upsertStreamToCampaign(campaign, stream)
|
|
123
|
+
// await sleep(2000)
|
|
124
|
+
// }
|
|
125
|
+
// console.log("––––––––––––––––––––––––")
|
|
126
|
+
// }
|
|
127
|
+
// }
|
|
128
|
+
let removeGeosFromAllRedirectCampaigns = async (geoToRemove) => {
|
|
129
|
+
let allCampaigns = await keitaro_service_1.KeitaroService.getAllCampaigns();
|
|
130
|
+
let regexp = new RegExp(`^F #`);
|
|
131
|
+
const matchingCampaigns = allCampaigns.filter(campaign => regexp.exec(campaign.name));
|
|
132
|
+
for (let campaign of matchingCampaigns) {
|
|
133
|
+
console.log(campaign.name);
|
|
134
|
+
console.log("––––––––––––––––––––––––");
|
|
135
|
+
let streams = await keitaro_service_1.KeitaroService.getStreamsByCampaignId(campaign.id);
|
|
136
|
+
let botStream = streams[0];
|
|
137
|
+
botStream.name = "Bot Protection";
|
|
138
|
+
let owStream = streams.find(s => s.name == "OW");
|
|
139
|
+
for (let stream of [owStream, botStream]) {
|
|
140
|
+
if (!stream)
|
|
141
|
+
continue;
|
|
142
|
+
let geos = stream?.filters[0]?.payload;
|
|
143
|
+
if (!geos)
|
|
144
|
+
continue;
|
|
145
|
+
let index = geos.findIndex(geo => geo == geoToRemove);
|
|
146
|
+
geos.splice(index, 1);
|
|
147
|
+
let newGeos = stream.filters[0].payload = geos;
|
|
148
|
+
console.log({
|
|
149
|
+
name: stream.name,
|
|
150
|
+
geos: geos,
|
|
151
|
+
geosToRemove: geoToRemove,
|
|
152
|
+
newGeos: newGeos
|
|
153
|
+
});
|
|
154
|
+
await keitaro_service_1.KeitaroService.upsertStreamToCampaign(campaign, stream);
|
|
155
|
+
await (0, sleep_promise_1.default)(1200);
|
|
156
|
+
}
|
|
157
|
+
console.log("––––––––––––––––––––––––");
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
exports.removeGeosFromAllRedirectCampaigns = removeGeosFromAllRedirectCampaigns;
|
|
161
|
+
let createOrFindFlashRedirectCampaign = async (app) => {
|
|
162
|
+
if (app.keitaroData && app.keitaroData?.redirectCampaignId && app.keitaroData?.redirectCampaignId != 0) {
|
|
163
|
+
console.log("Already exists! Fetching...");
|
|
164
|
+
let campaign = await keitaro_service_1.KeitaroService.getCampaignById(app.keitaroData.redirectCampaignId);
|
|
165
|
+
return campaign;
|
|
166
|
+
}
|
|
167
|
+
// Checking for already existing campaign
|
|
168
|
+
let allCampaigns = await keitaro_service_1.KeitaroService.getAllCampaigns();
|
|
169
|
+
let regexp = new RegExp(`^F #${app.id}`);
|
|
170
|
+
const matchingCampaigns = allCampaigns.filter(campaign => regexp.exec(campaign.name));
|
|
171
|
+
if (matchingCampaigns.length != 0) {
|
|
172
|
+
let campaign = matchingCampaigns[0];
|
|
173
|
+
if (app.keitaroData)
|
|
174
|
+
app.keitaroData.redirectCampaignId = campaign.id;
|
|
175
|
+
console.log("Already exists!");
|
|
176
|
+
// await app.save()
|
|
177
|
+
return campaign;
|
|
178
|
+
}
|
|
179
|
+
// Select domain for a campaign
|
|
180
|
+
let allDomains = await keitaro_service_1.KeitaroService.getDomains(true);
|
|
181
|
+
if (!allDomains) {
|
|
182
|
+
throw Error(`Failed to get all domains list`);
|
|
183
|
+
}
|
|
184
|
+
const domain = allDomains[Math.floor(Math.random() * allDomains.length)];
|
|
185
|
+
// Okay, now we have everything, let's create name for our campaign
|
|
186
|
+
const name = `F #${app.id} (${app.bundle})`;
|
|
187
|
+
// And generate alias
|
|
188
|
+
const alias = Array.from({ length: 8 }, () => Math.floor(Math.random() * 36).toString(36)).join('');
|
|
189
|
+
// Here go the parameters for our campaign
|
|
190
|
+
let parameters = prepareRedirectCampaignParameters(app.id);
|
|
191
|
+
// Now let create a campaign object
|
|
192
|
+
let campaignData = prepareCampaignObject(name, alias, domain, parameters);
|
|
193
|
+
// And POST it to Keitaro!
|
|
194
|
+
let createdCampaign = await keitaro_service_1.KeitaroService.createCampaign(campaignData);
|
|
195
|
+
console.log(`Done! Campaign data:`);
|
|
196
|
+
console.log(createdCampaign);
|
|
197
|
+
return createdCampaign;
|
|
198
|
+
};
|
|
199
|
+
exports.createOrFindFlashRedirectCampaign = createOrFindFlashRedirectCampaign;
|
|
200
|
+
let prepareCampaignObject = (name, alias, domain, parameters) => {
|
|
201
|
+
return {
|
|
202
|
+
name: name,
|
|
203
|
+
alias: alias,
|
|
204
|
+
type: TYPE_POSITION,
|
|
205
|
+
uniqueness_method: UNIQUENESS_METHOD,
|
|
206
|
+
cookies_ttl: MAX_COOKIES_TTL,
|
|
207
|
+
state: STATE_ACTIVE,
|
|
208
|
+
cost_type: COST_TYPE_CPC,
|
|
209
|
+
cost_value: COST_VALUE,
|
|
210
|
+
cost_currency: COST_CURRENCY_USD,
|
|
211
|
+
group_id: FLASH_REDIRECT_GROUP_ID,
|
|
212
|
+
traffic_source_id: exports.TRAFFIC_SOURCE_ID_FLASH_AI,
|
|
213
|
+
domain_id: domain.id,
|
|
214
|
+
parameters: parameters,
|
|
215
|
+
uniqueness_use_cookies: true,
|
|
216
|
+
traffic_loss: 0
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
let prepareRedirectCampaignParameters = (appId) => {
|
|
220
|
+
return {
|
|
221
|
+
"keyword": {
|
|
222
|
+
"name": "keyword",
|
|
223
|
+
"placeholder": "",
|
|
224
|
+
"alias": ""
|
|
225
|
+
},
|
|
226
|
+
"cost": {
|
|
227
|
+
"name": "cost",
|
|
228
|
+
"placeholder": "",
|
|
229
|
+
"alias": ""
|
|
230
|
+
},
|
|
231
|
+
"currency": {
|
|
232
|
+
"name": "currency",
|
|
233
|
+
"placeholder": "",
|
|
234
|
+
"alias": ""
|
|
235
|
+
},
|
|
236
|
+
"external_id": {
|
|
237
|
+
"name": "external_id",
|
|
238
|
+
"placeholder": "",
|
|
239
|
+
"alias": ""
|
|
240
|
+
},
|
|
241
|
+
"creative_id": {
|
|
242
|
+
"name": "creative_id",
|
|
243
|
+
"placeholder": "",
|
|
244
|
+
"alias": ""
|
|
245
|
+
},
|
|
246
|
+
"ad_campaign_id": {
|
|
247
|
+
"name": "ad_campaign_id",
|
|
248
|
+
"placeholder": "",
|
|
249
|
+
"alias": ""
|
|
250
|
+
},
|
|
251
|
+
"source": {
|
|
252
|
+
"name": "source",
|
|
253
|
+
"placeholder": "",
|
|
254
|
+
"alias": ""
|
|
255
|
+
},
|
|
256
|
+
sub_id_1: {
|
|
257
|
+
name: "appId",
|
|
258
|
+
placeholder: `${appId}`,
|
|
259
|
+
alias: ""
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
let prepareOWCampaignParameters = (app) => {
|
|
264
|
+
return {
|
|
265
|
+
"keyword": {
|
|
266
|
+
"name": "keyword",
|
|
267
|
+
"placeholder": "",
|
|
268
|
+
"alias": ""
|
|
269
|
+
},
|
|
270
|
+
"cost": {
|
|
271
|
+
"name": "cost",
|
|
272
|
+
"placeholder": "",
|
|
273
|
+
"alias": ""
|
|
274
|
+
},
|
|
275
|
+
"currency": {
|
|
276
|
+
"name": "currency",
|
|
277
|
+
"placeholder": "",
|
|
278
|
+
"alias": ""
|
|
279
|
+
},
|
|
280
|
+
"external_id": {
|
|
281
|
+
"name": "external_id",
|
|
282
|
+
"placeholder": "",
|
|
283
|
+
"alias": ""
|
|
284
|
+
},
|
|
285
|
+
"creative_id": {
|
|
286
|
+
"name": "creative_id",
|
|
287
|
+
"placeholder": "",
|
|
288
|
+
"alias": ""
|
|
289
|
+
},
|
|
290
|
+
"ad_campaign_id": {
|
|
291
|
+
"name": "ad_campaign_id",
|
|
292
|
+
"placeholder": "",
|
|
293
|
+
"alias": ""
|
|
294
|
+
},
|
|
295
|
+
"source": {
|
|
296
|
+
"name": "source",
|
|
297
|
+
"placeholder": "",
|
|
298
|
+
"alias": ""
|
|
299
|
+
},
|
|
300
|
+
sub_id_8: {
|
|
301
|
+
"name": app.keitaroData?.clickIdParameterName || "",
|
|
302
|
+
"placeholder": "{click_id}",
|
|
303
|
+
"alias": "click_id"
|
|
304
|
+
},
|
|
305
|
+
sub_id_15: {
|
|
306
|
+
"name": app.keitaroData?.offerIdParameterName || "",
|
|
307
|
+
"placeholder": "{offer_custom_id}",
|
|
308
|
+
"alias": "offer_custom_id"
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
exports.prepareOWCampaignParameters = prepareOWCampaignParameters;
|
|
313
|
+
function createBPStreamPartialPayload(app) {
|
|
314
|
+
return {
|
|
315
|
+
name: `Bot Protection`,
|
|
316
|
+
type: "forced",
|
|
317
|
+
action_type: "http",
|
|
318
|
+
action_payload: "https://tomain.com",
|
|
319
|
+
schema: "redirect",
|
|
320
|
+
filter_or: true,
|
|
321
|
+
collect_clicks: true,
|
|
322
|
+
weight: 0,
|
|
323
|
+
filters: [{
|
|
324
|
+
name: "country",
|
|
325
|
+
mode: "reject",
|
|
326
|
+
payload: app.geos.split(" ")
|
|
327
|
+
}, {
|
|
328
|
+
name: "bot",
|
|
329
|
+
mode: "accept",
|
|
330
|
+
payload: null,
|
|
331
|
+
}],
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
function createDefenceMainStreamPartialPayload(app) {
|
|
335
|
+
return {
|
|
336
|
+
name: "ALL",
|
|
337
|
+
type: "regular",
|
|
338
|
+
action_type: "http",
|
|
339
|
+
action_payload: app.sourceUrl,
|
|
340
|
+
schema: "redirect",
|
|
341
|
+
filter_or: false,
|
|
342
|
+
collect_clicks: true,
|
|
343
|
+
weight: 100,
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
function createOWStreamPartialPayload(app) {
|
|
347
|
+
return {
|
|
348
|
+
name: `OW`,
|
|
349
|
+
type: "regular",
|
|
350
|
+
action_type: "http",
|
|
351
|
+
action_payload: "https://bprtsk-controlpanel.com/ow?appId={appId}&clickId={uid}&countryCode={country}",
|
|
352
|
+
schema: "redirect",
|
|
353
|
+
filter_or: false,
|
|
354
|
+
collect_clicks: true,
|
|
355
|
+
weight: 100,
|
|
356
|
+
filters: [{
|
|
357
|
+
name: "country",
|
|
358
|
+
mode: "accept",
|
|
359
|
+
payload: app.geos.split(" ")
|
|
360
|
+
}],
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
exports.createOWStreamPartialPayload = createOWStreamPartialPayload;
|
|
364
|
+
async function createFlashCampaigns(app) {
|
|
365
|
+
// Upserting Flash Redirect campaign
|
|
366
|
+
let redirectCampaign = await (0, exports.createOrFindFlashRedirectCampaign)(app);
|
|
367
|
+
console.log(`Redirect campaign name:`);
|
|
368
|
+
console.log(`${redirectCampaign.domain}/${redirectCampaign.alias}?uid=`);
|
|
369
|
+
// Upserting necessary streams
|
|
370
|
+
let botProtectionStream = createBPStreamPartialPayload(app);
|
|
371
|
+
let owStream = createOWStreamPartialPayload(app);
|
|
372
|
+
for (let stream of [botProtectionStream, owStream]) {
|
|
373
|
+
await keitaro_service_1.KeitaroService.upsertStreamToCampaign(redirectCampaign, stream);
|
|
374
|
+
}
|
|
375
|
+
// Upserting OW campaign
|
|
376
|
+
let owCampaign = await keitaro_service_1.KeitaroService.cloneOWCampaign(app);
|
|
377
|
+
return {
|
|
378
|
+
tracking: owCampaign,
|
|
379
|
+
redirect: redirectCampaign
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
exports.createFlashCampaigns = createFlashCampaigns;
|
|
383
|
+
async function createDirectCampaign(app) {
|
|
384
|
+
let campaign = await keitaro_service_1.KeitaroService.cloneDCampaign(app);
|
|
385
|
+
let stream = createDefenceMainStreamPartialPayload(app);
|
|
386
|
+
await keitaro_service_1.KeitaroService.upsertStreamToCampaign(campaign, stream);
|
|
387
|
+
return campaign;
|
|
388
|
+
}
|
|
389
|
+
exports.createDirectCampaign = createDirectCampaign;
|
|
390
|
+
async function createOWCampaign(app) {
|
|
391
|
+
let owCampaign = await keitaro_service_1.KeitaroService.cloneOWCampaign(app);
|
|
392
|
+
return owCampaign;
|
|
393
|
+
}
|
|
394
|
+
exports.createOWCampaign = createOWCampaign;
|
|
395
|
+
// TODO separate files for offers, campaigns etc.
|
|
396
|
+
let removeBrokenDomain = async () => {
|
|
397
|
+
let regexp = new RegExp(`^FA #`);
|
|
398
|
+
let campaigns = (await keitaro_service_1.KeitaroService.getAllCampaigns()).filter(campaign => regexp.exec(campaign.name) && campaign.domain == "https://slottibolt.com/");
|
|
399
|
+
for (let campaign of campaigns) {
|
|
400
|
+
console.log(campaign.name);
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
let changeSourceForFA = async () => {
|
|
404
|
+
let regexp = new RegExp(`^FA #`);
|
|
405
|
+
let campaigns = (await keitaro_service_1.KeitaroService.getAllCampaigns()).filter(campaign => regexp.exec(campaign.name));
|
|
406
|
+
for (let campaign of campaigns) {
|
|
407
|
+
console.log(campaign.name);
|
|
408
|
+
await keitaro_service_1.KeitaroService.updateCampaign(campaign.id, {
|
|
409
|
+
traffic_source_id: 22
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
let replaceInOfferLink = async (old, replace, offerNameRegEx) => {
|
|
414
|
+
let offers = await keitaro_service_1.KeitaroService.getAllOffers();
|
|
415
|
+
offers = offers.filter((o) => offerNameRegEx.exec(o.name));
|
|
416
|
+
for (let offer of offers) {
|
|
417
|
+
console.log(offer.name);
|
|
418
|
+
// offer.action_payload = offer.action_payload.replace(old, replace)
|
|
419
|
+
await (0, sleep_promise_1.default)(700);
|
|
420
|
+
await keitaro_service_1.KeitaroService.updateOffer(offer);
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
// let gatherInfoForFlashApps = async () => {
|
|
424
|
+
// console.log(__dirname)
|
|
425
|
+
// const pasteMap: PasteMap = JSON.parse(await readFile('/Users/bprtsk/Documents/Work/ASO/AI Control Panel /AI Panel Core/src/utils/map-paste.json', 'utf8'));
|
|
426
|
+
// const trackingMap: TrackingMap = JSON.parse(await readFile('/Users/bprtsk/Documents/Work/ASO/AI Control Panel /AI Panel Core/src/utils/map-tracking.json', 'utf8'));
|
|
427
|
+
// const flashApps: { [key: string]: IFlashApp | undefined } = JSON.parse(await readFile('/Users/bprtsk/Documents/Work/ASO/AI Control Panel /AI Panel Core/src/utils/map-apps.json', 'utf8'));
|
|
428
|
+
// let allCampaigns = await KeitaroService.getAllCampaigns()
|
|
429
|
+
// let owCampaigns = allCampaigns.filter(c => new RegExp(`^FA #`).exec(c.name)).reduce((acc, obj) => ({ ...acc, [new RegExp(/#(.*) \(/g).exec(obj.name)?.[1] || obj.name]: obj }), {});
|
|
430
|
+
// let redirectCampaigns = allCampaigns.filter(c => new RegExp(`^F #`).exec(c.name)).reduce((acc, obj) => ({ ...acc, [new RegExp(/#(.*) \(/g).exec(obj.name)?.[1] || obj.name]: obj }), {});
|
|
431
|
+
// let result = []
|
|
432
|
+
// for (let [id, paste] of Object.entries(pasteMap)) {
|
|
433
|
+
// console.log(`- #${id}`)
|
|
434
|
+
// // let ow = owCampaigns[id as keyof object] as IKeitaroCampaign | undefined
|
|
435
|
+
// // let redirect = redirectCampaigns[id as keyof object] as IKeitaroCampaign | undefined
|
|
436
|
+
// // let tracking = trackingMap[id as keyof object]
|
|
437
|
+
// let app = flashApps[id as keyof object]
|
|
438
|
+
// if (!app) {
|
|
439
|
+
// console.log(`! No app for ${id}`)
|
|
440
|
+
// continue
|
|
441
|
+
// }
|
|
442
|
+
// // if (paste.status == FlashAppPlugStatus.ENABLED) {
|
|
443
|
+
// // if (!ow) console.log(`#${id}: no OW`)
|
|
444
|
+
// // if (!redirect) console.log(`No redirect for #${id}`)
|
|
445
|
+
// // else if (!paste.content.includes(redirect.domain)) console.log(`#${id}: Redirect domain (${redirect.domain}) differs from paste domain (${paste.content})`)
|
|
446
|
+
// // else if (!paste.content.includes(redirect.alias)) console.log(`#${id}: Redirect campaign alias (${redirect.alias}) differs from paste id (${paste.content})`)
|
|
447
|
+
// // }
|
|
448
|
+
// // let appId
|
|
449
|
+
// // for (let parameter of Object.values(redirect?.parameters || {})) {
|
|
450
|
+
// // if (parameter.name == "appId") {
|
|
451
|
+
// // appId = parameter.placeholder
|
|
452
|
+
// // }
|
|
453
|
+
// // }
|
|
454
|
+
// // if (!appId && ow) console.log(`No app id for #${id}`)
|
|
455
|
+
// // else if (appId != id && ow) console.log(`Wrong app id (${appId}) for #${id}`)
|
|
456
|
+
// // let owDomain = ow?.domain?.split("/")[2]
|
|
457
|
+
// // let owDomainId = ow?.domain_id
|
|
458
|
+
// // let owCampaignId = ow?.id
|
|
459
|
+
// // let owCampaignName = ow?.name
|
|
460
|
+
// // let owCampaignAlias = ow?.alias
|
|
461
|
+
// // let redirectDomain = redirect?.domain?.split("/")[2]
|
|
462
|
+
// // let redirectDomainId = redirect?.domain_id
|
|
463
|
+
// // let redirectCampaignId = redirect?.id
|
|
464
|
+
// // let redirectCampaignName = redirect?.name
|
|
465
|
+
// // let redirectCampaignAlias = redirect?.alias
|
|
466
|
+
// // let clickIdParameterName = ow?.parameters?.sub_id_8?.name
|
|
467
|
+
// // let offerIdParameterName = ow?.parameters?.sub_id_15?.name
|
|
468
|
+
// // if (!clickIdParameterName && app && ow) console.log(`No click id parameter for #${id}`)
|
|
469
|
+
// // if (!offerIdParameterName && app && ow) console.log(`No offer id parameter for #${id}`)
|
|
470
|
+
// // let trackingLink = tracking?.trackingUrl
|
|
471
|
+
// // app.plugStatus = paste.status
|
|
472
|
+
// // app.plugContent = paste.content
|
|
473
|
+
// // app.plugType = PlugType.PASTEBIN
|
|
474
|
+
// // app.plugId = paste.paste_id
|
|
475
|
+
// // app.reservePlugType = PlugType.PASTEBIN
|
|
476
|
+
// // app.plugAccountId = parseInt(paste.accountId)
|
|
477
|
+
// // app.keitaroData.redirectDomainName = redirectDomain || "none"
|
|
478
|
+
// // app.keitaroData.redirectDomainId = redirectDomainId || 0
|
|
479
|
+
// // app.keitaroData.redirectCampaignId = redirectCampaignId || 0
|
|
480
|
+
// // app.keitaroData.redirectCampaignName = redirectCampaignName || "none"
|
|
481
|
+
// // app.keitaroData.redirectCampaignAlias = redirectCampaignAlias || "none"
|
|
482
|
+
// // app.keitaroData.trackingDomainId = owDomainId || 0
|
|
483
|
+
// // app.keitaroData.trackingDomainName = owDomain || "none"
|
|
484
|
+
// // app.keitaroData.trackingCampaignId = owCampaignId || 0
|
|
485
|
+
// // app.keitaroData.trackingCampaignName = owCampaignName || "none"
|
|
486
|
+
// // app.keitaroData.trackingCampaignAlias = owCampaignAlias || "none"
|
|
487
|
+
// // if (clickIdParameterName) app.keitaroData.clickIdParameterName = clickIdParameterName
|
|
488
|
+
// // if (offerIdParameterName) app.keitaroData.offerIdParameterName = offerIdParameterName
|
|
489
|
+
// // if (trackingLink) app.trackingUrl = trackingLink
|
|
490
|
+
// // if (!owCampaignName?.includes(app.bundle) && ow) {
|
|
491
|
+
// // console.log(`OW: bundle differs (${app.bundle} in DB and ${owCampaignName})`)
|
|
492
|
+
// // }
|
|
493
|
+
// // if (!redirectCampaignName?.includes(app.bundle) && redirect) {
|
|
494
|
+
// // console.log(`Redirect: bundle differs (${app.bundle} in DB and ${redirectCampaignName})`)
|
|
495
|
+
// // }
|
|
496
|
+
// result.push(app)
|
|
497
|
+
// console.log("--------------------")
|
|
498
|
+
// }
|
|
499
|
+
// await axios.post(`https://aipanel-secondary.com/flash/batch-update`, result, {
|
|
500
|
+
// headers: {
|
|
501
|
+
// "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWF0IjoxNjg3Mjc2NjA0LCJleHAiOjE2ODc4ODE0MDR9.XesrnNGmWlK-yBBMs5TeKvTe07A8Sud7B4MyfZAOMag"
|
|
502
|
+
// }
|
|
503
|
+
// })
|
|
504
|
+
// // console.log(result)
|
|
505
|
+
// }
|
|
506
|
+
let findBrokenOfferStreams = async () => {
|
|
507
|
+
let allCampaigns = await keitaro_service_1.KeitaroService.getAllCampaigns();
|
|
508
|
+
let regexp = new RegExp(`^FA #`);
|
|
509
|
+
const matchingCampaigns = allCampaigns.filter(campaign => regexp.exec(campaign.name));
|
|
510
|
+
for (let campaign of matchingCampaigns) {
|
|
511
|
+
console.log(campaign.name);
|
|
512
|
+
console.log("––––––––––––––––––––––––");
|
|
513
|
+
let streams = await keitaro_service_1.KeitaroService.getStreamsByCampaignId(campaign.id);
|
|
514
|
+
for (let stream of streams) {
|
|
515
|
+
if (stream.name == "Bot Protection")
|
|
516
|
+
continue;
|
|
517
|
+
let idPayload = stream.filters.find(f => f.name == "sub_id_15");
|
|
518
|
+
if (!idPayload) {
|
|
519
|
+
console.log(`${stream.name}: id payload is missing, payload: ${stream.filters}`);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
let moveCampaignsToAnotherGroup = async () => {
|
|
525
|
+
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];
|
|
526
|
+
await keitaro_service_1.KeitaroService.changeCampaignsGroup(from, to, exceptFor);
|
|
527
|
+
};
|
|
528
|
+
// moveCampaignsToAnotherGroup()
|
|
529
|
+
// Getting campaign group ids
|
|
530
|
+
// (async () => {
|
|
531
|
+
// let campaigns = await KeitaroService.getAllCampaigns()
|
|
532
|
+
// let normal = campaigns.find(c => c.id == 2684)
|
|
533
|
+
// let archive = campaigns.find(c => c.id == 2679)
|
|
534
|
+
// console.log([normal?.group_id, archive?.group_id])
|
|
535
|
+
// })()
|
|
536
|
+
// findBrokenOfferStreams()
|
|
537
|
+
// removeBrokenDomain()
|
|
538
|
+
// createFlashCampaigns(sampleApp)
|
|
539
|
+
// changeSourceForFA()
|
|
540
|
+
// addGeosToAllRedirectCam`paigns("GR")
|
|
541
|
+
// removeGeosFromAllRedirectCampaigns("BE`")
|
|
542
|
+
// gatherInfoForFlashApps()
|
|
543
|
+
// replaceInOfferLink(`xmariorel.com`, `lalielynaualish.com`, /.*icecasino_huffson.*/g)
|
|
544
|
+
// replaceInOfferLink(`lp=18`, `lp=00`, /.*icecasino_huffson.*/g)
|