@bprotsyk/aso-core 2.1.96 → 2.1.98
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/app/app.d.ts +11 -0
- package/lib/app/app.js +14 -1
- package/lib/general/domain.d.ts +3 -3
- package/lib/utils/keitaro-utils.js +4 -1
- package/package.json +1 -1
- package/src/app/app.ts +14 -0
- package/src/utils/keitaro-utils.ts +8 -5
package/lib/app/app.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface IApp extends Document {
|
|
|
9
9
|
pushesEnabled?: boolean;
|
|
10
10
|
policyUrl?: string;
|
|
11
11
|
type: AppType;
|
|
12
|
+
status: AppStatus;
|
|
12
13
|
geo: string[];
|
|
13
14
|
onesignalAppId: string;
|
|
14
15
|
onesignalRestApiKey: string;
|
|
@@ -114,6 +115,13 @@ export interface IBannerParams {
|
|
|
114
115
|
linkParam: string;
|
|
115
116
|
showStubOnError?: boolean;
|
|
116
117
|
}
|
|
118
|
+
export declare enum AppStatus {
|
|
119
|
+
INACTIVE = "INACTIVE",
|
|
120
|
+
PUBLISHED = "PUBLISHED",
|
|
121
|
+
MODERATION = "ACTIVE",
|
|
122
|
+
REMOVED = "REMOVED",
|
|
123
|
+
ARCHIVED = "ARCHIVED"
|
|
124
|
+
}
|
|
117
125
|
export interface IRemoveDataParams {
|
|
118
126
|
buttonText: string;
|
|
119
127
|
resultText: string;
|
|
@@ -167,6 +175,7 @@ export declare const AppSchema: mongoose.Schema<any, mongoose.Model<any, any, an
|
|
|
167
175
|
proxied: boolean;
|
|
168
176
|
ech: boolean;
|
|
169
177
|
imageFormat: string;
|
|
178
|
+
status: string;
|
|
170
179
|
bundle: string;
|
|
171
180
|
trackingUrl: string;
|
|
172
181
|
integrationVersion: string;
|
|
@@ -206,6 +215,7 @@ export declare const AppSchema: mongoose.Schema<any, mongoose.Model<any, any, an
|
|
|
206
215
|
proxied: boolean;
|
|
207
216
|
ech: boolean;
|
|
208
217
|
imageFormat: string;
|
|
218
|
+
status: string;
|
|
209
219
|
bundle: string;
|
|
210
220
|
trackingUrl: string;
|
|
211
221
|
integrationVersion: string;
|
|
@@ -245,6 +255,7 @@ export declare const AppSchema: mongoose.Schema<any, mongoose.Model<any, any, an
|
|
|
245
255
|
proxied: boolean;
|
|
246
256
|
ech: boolean;
|
|
247
257
|
imageFormat: string;
|
|
258
|
+
status: string;
|
|
248
259
|
bundle: string;
|
|
249
260
|
trackingUrl: string;
|
|
250
261
|
integrationVersion: string;
|
package/lib/app/app.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AppSchema = exports.PlugType = exports.IntegrationVersion = exports.getPlatformName = exports.EDirectType = exports.EPlatform = exports.EImageFormat = void 0;
|
|
3
|
+
exports.AppSchema = exports.PlugType = exports.IntegrationVersion = exports.AppStatus = exports.getPlatformName = exports.EDirectType = exports.EPlatform = exports.EImageFormat = void 0;
|
|
4
4
|
const app_type_1 = require("./app-type");
|
|
5
5
|
const mongoose_1 = require("mongoose");
|
|
6
6
|
const util = require("util");
|
|
@@ -49,6 +49,14 @@ const getPlatformName = (platform) => {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
exports.getPlatformName = getPlatformName;
|
|
52
|
+
var AppStatus;
|
|
53
|
+
(function (AppStatus) {
|
|
54
|
+
AppStatus["INACTIVE"] = "INACTIVE";
|
|
55
|
+
AppStatus["PUBLISHED"] = "PUBLISHED";
|
|
56
|
+
AppStatus["MODERATION"] = "ACTIVE";
|
|
57
|
+
AppStatus["REMOVED"] = "REMOVED";
|
|
58
|
+
AppStatus["ARCHIVED"] = "ARCHIVED";
|
|
59
|
+
})(AppStatus = exports.AppStatus || (exports.AppStatus = {}));
|
|
52
60
|
var IntegrationVersion;
|
|
53
61
|
(function (IntegrationVersion) {
|
|
54
62
|
IntegrationVersion["NONE"] = "MVVM";
|
|
@@ -90,6 +98,11 @@ exports.AppSchema = new mongoose_1.Schema({
|
|
|
90
98
|
enum: EImageFormat,
|
|
91
99
|
default: EImageFormat.PNG
|
|
92
100
|
},
|
|
101
|
+
status: {
|
|
102
|
+
type: String,
|
|
103
|
+
enum: AppStatus,
|
|
104
|
+
default: AppStatus.INACTIVE
|
|
105
|
+
},
|
|
93
106
|
bundle: {
|
|
94
107
|
type: String,
|
|
95
108
|
unique: true,
|
package/lib/general/domain.d.ts
CHANGED
|
@@ -91,9 +91,9 @@ export declare const DomainSchema: Schema<any, Model<any, any, any, any, any, an
|
|
|
91
91
|
caption?: string | null | undefined;
|
|
92
92
|
title?: string | null | undefined;
|
|
93
93
|
proxied?: boolean | null | undefined;
|
|
94
|
+
status?: string | null | undefined;
|
|
94
95
|
ip?: string | null | undefined;
|
|
95
96
|
namecheapId?: string | null | undefined;
|
|
96
|
-
status?: string | null | undefined;
|
|
97
97
|
isUpdating?: boolean | null | undefined;
|
|
98
98
|
cloudflareStatus?: string | null | undefined;
|
|
99
99
|
paused?: boolean | null | undefined;
|
|
@@ -118,9 +118,9 @@ export declare const DomainSchema: Schema<any, Model<any, any, any, any, any, an
|
|
|
118
118
|
caption?: string | null | undefined;
|
|
119
119
|
title?: string | null | undefined;
|
|
120
120
|
proxied?: boolean | null | undefined;
|
|
121
|
+
status?: string | null | undefined;
|
|
121
122
|
ip?: string | null | undefined;
|
|
122
123
|
namecheapId?: string | null | undefined;
|
|
123
|
-
status?: string | null | undefined;
|
|
124
124
|
isUpdating?: boolean | null | undefined;
|
|
125
125
|
cloudflareStatus?: string | null | undefined;
|
|
126
126
|
paused?: boolean | null | undefined;
|
|
@@ -145,9 +145,9 @@ export declare const DomainSchema: Schema<any, Model<any, any, any, any, any, an
|
|
|
145
145
|
caption?: string | null | undefined;
|
|
146
146
|
title?: string | null | undefined;
|
|
147
147
|
proxied?: boolean | null | undefined;
|
|
148
|
+
status?: string | null | undefined;
|
|
148
149
|
ip?: string | null | undefined;
|
|
149
150
|
namecheapId?: string | null | undefined;
|
|
150
|
-
status?: string | null | undefined;
|
|
151
151
|
isUpdating?: boolean | null | undefined;
|
|
152
152
|
cloudflareStatus?: string | null | undefined;
|
|
153
153
|
paused?: boolean | null | undefined;
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.sendPostbacks = exports.createOWCampaign = exports.createDirectCampaign = exports.prepareOWCampaignParameters = exports.removeGeosFromAllRedirectCampaigns = exports.addGeosToAllRedirectCampaigns = exports.TRAFFIC_SOURCE_ID_FLASH_AI = void 0;
|
|
7
7
|
const keitaro_service_1 = require("../network/keitaro/keitaro-service");
|
|
8
|
-
const sleep = require('sleep-promise');
|
|
9
8
|
const axios_1 = __importDefault(require("axios"));
|
|
10
9
|
const keitaro_clicks_1 = require("../keitaro/keitaro-clicks");
|
|
11
10
|
const FLASH_REDIRECT_GROUP_ID = 82;
|
|
@@ -59,6 +58,10 @@ const COST_CURRENCY_USD = "USD";
|
|
|
59
58
|
// offerIdParameterName: "i",
|
|
60
59
|
// }
|
|
61
60
|
// } as IFlashApp
|
|
61
|
+
function sleep(ms) {
|
|
62
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
63
|
+
}
|
|
64
|
+
``;
|
|
62
65
|
let addGeosToAllRedirectCampaigns = async (geosToAdd) => {
|
|
63
66
|
let allCampaigns = await keitaro_service_1.KeitaroService.getAllCampaigns();
|
|
64
67
|
let regexp = new RegExp(`^F #`);
|
package/package.json
CHANGED
package/src/app/app.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface IApp extends Document {
|
|
|
14
14
|
pushesEnabled?: boolean
|
|
15
15
|
policyUrl?: string
|
|
16
16
|
type: AppType
|
|
17
|
+
status: AppStatus
|
|
17
18
|
geo: string[]
|
|
18
19
|
|
|
19
20
|
onesignalAppId: string
|
|
@@ -161,6 +162,14 @@ export interface IBannerParams {
|
|
|
161
162
|
showStubOnError?: boolean,
|
|
162
163
|
}
|
|
163
164
|
|
|
165
|
+
export enum AppStatus {
|
|
166
|
+
INACTIVE = "INACTIVE",
|
|
167
|
+
PUBLISHED = "PUBLISHED",
|
|
168
|
+
MODERATION = "ACTIVE",
|
|
169
|
+
REMOVED = "REMOVED",
|
|
170
|
+
ARCHIVED = "ARCHIVED"
|
|
171
|
+
}
|
|
172
|
+
|
|
164
173
|
export interface IRemoveDataParams {
|
|
165
174
|
buttonText: string,
|
|
166
175
|
resultText: string,
|
|
@@ -240,6 +249,11 @@ export const AppSchema = new Schema({
|
|
|
240
249
|
enum: EImageFormat,
|
|
241
250
|
default: EImageFormat.PNG
|
|
242
251
|
},
|
|
252
|
+
status: {
|
|
253
|
+
type: String,
|
|
254
|
+
enum: AppStatus,
|
|
255
|
+
default: AppStatus.INACTIVE
|
|
256
|
+
},
|
|
243
257
|
|
|
244
258
|
bundle: {
|
|
245
259
|
type: String,
|
|
@@ -4,7 +4,6 @@ import { AppType } from "../app/app-type"
|
|
|
4
4
|
import { IKeitaroCampaign, IKeitaroCampaignParameters } from "../keitaro/keitaro-campaign"
|
|
5
5
|
import { IKeitaroDomain } from "../keitaro/keitaro-domain"
|
|
6
6
|
import { KeitaroService } from "../network/keitaro/keitaro-service"
|
|
7
|
-
const sleep = require('sleep-promise');
|
|
8
7
|
import * as util from 'util';
|
|
9
8
|
import axios from "axios"
|
|
10
9
|
import { getTimestampsForTodayAndYesterday } from "../utils/general"
|
|
@@ -68,6 +67,10 @@ const COST_CURRENCY_USD = "USD"
|
|
|
68
67
|
// }
|
|
69
68
|
// } as IFlashApp
|
|
70
69
|
|
|
70
|
+
function sleep(ms: number): Promise<void> {
|
|
71
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
72
|
+
}``
|
|
73
|
+
|
|
71
74
|
export let addGeosToAllRedirectCampaigns = async (geosToAdd: string) => {
|
|
72
75
|
let allCampaigns = await KeitaroService.getAllCampaigns()
|
|
73
76
|
|
|
@@ -409,8 +412,8 @@ export let prepareOWCampaignParameters = (app: IApp): IKeitaroCampaignParameters
|
|
|
409
412
|
"placeholder": "",
|
|
410
413
|
"alias": "offer_id"
|
|
411
414
|
},
|
|
412
|
-
|
|
413
|
-
|
|
415
|
+
|
|
416
|
+
|
|
414
417
|
}
|
|
415
418
|
}
|
|
416
419
|
|
|
@@ -477,7 +480,7 @@ export async function createDirectCampaign(app: IApp) {
|
|
|
477
480
|
return campaign
|
|
478
481
|
}
|
|
479
482
|
|
|
480
|
-
export async function createOWCampaign(app: IApp, platform?: EPlatform
|
|
483
|
+
export async function createOWCampaign(app: IApp, platform?: EPlatform) {
|
|
481
484
|
let owCampaign = await KeitaroService.cloneOWCampaign(app, platform)
|
|
482
485
|
|
|
483
486
|
return owCampaign
|
|
@@ -800,7 +803,7 @@ async function checkMultipleIPs() {
|
|
|
800
803
|
try {
|
|
801
804
|
const clicks = await getClicksByIp(ip, 2832, KeitaroClicksInterval.SEVEN_DAYS_AGO);
|
|
802
805
|
subids.push(clicks[clicks.length - 1].sub_id)
|
|
803
|
-
} catch (error) {
|
|
806
|
+
} catch (error) { }
|
|
804
807
|
await sleep(300); // Delay to avoid rate limiting
|
|
805
808
|
}
|
|
806
809
|
|