@bprotsyk/aso-core 2.1.60 → 2.1.62
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 +4 -30
- package/lib/app/app.js +0 -5
- package/lib/index.d.ts +1 -1
- package/lib/utils/keitaro-utils.d.ts +0 -2
- package/lib/utils/keitaro-utils.js +39 -40
- package/package.json +1 -1
- package/src/app/app.ts +5 -33
- package/src/index.ts +1 -1
- package/src/panel/app/upsert-flash-app-request.ts +1 -1
- package/src/utils/keitaro-utils.ts +38 -38
package/lib/app/app.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { AlternativeLayoutType, AlternativeLogicType, AlternativeNavigation, AlternativeNetworkTool, AlternativeOnActivityResult, AlternativeOnBackPressed, AlternativeSourceType, AlternativeStorageType } from "index";
|
|
2
1
|
import { AppType } from "./app-type";
|
|
3
2
|
import mongoose, { Document } from "mongoose";
|
|
4
|
-
import { AlternativeFullscreen } from "app/app-integration";
|
|
5
3
|
export interface IApp extends Document {
|
|
6
4
|
id: number;
|
|
7
5
|
enabled: boolean;
|
|
@@ -11,14 +9,12 @@ export interface IApp extends Document {
|
|
|
11
9
|
pushesEnabled?: boolean;
|
|
12
10
|
policyUrl?: string;
|
|
13
11
|
type: AppType;
|
|
14
|
-
geos: string;
|
|
15
12
|
geo: string[];
|
|
16
13
|
onesignalAppId: string;
|
|
17
14
|
onesignalRestApiKey: string;
|
|
18
15
|
appmetricaApiKey?: string;
|
|
19
16
|
appmetricaAppId?: number;
|
|
20
17
|
webInterfaceName: string;
|
|
21
|
-
generationOptions: IAppGenerationOptions;
|
|
22
18
|
keitaroData: IAppKeitaroData | null;
|
|
23
19
|
integrationVersion: IntegrationVersion;
|
|
24
20
|
offersStubParams?: IOffersStubParams;
|
|
@@ -53,12 +49,15 @@ export declare const getPlatformName: (platform: EPlatform | undefined) => strin
|
|
|
53
49
|
export interface IPlatformParams {
|
|
54
50
|
enabled: boolean;
|
|
55
51
|
geo: string[];
|
|
56
|
-
customCampaignData?: IAppKeitaroData;
|
|
57
52
|
trackingUrl?: string;
|
|
58
53
|
adjustParams?: {
|
|
59
54
|
appId: string;
|
|
60
55
|
eventIds: IAdjustEventIds;
|
|
61
56
|
};
|
|
57
|
+
direct?: {
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
keitaroData: IAppKeitaroData | boolean;
|
|
60
|
+
};
|
|
62
61
|
metricaParams?: {
|
|
63
62
|
appId: number;
|
|
64
63
|
postApiKey: string;
|
|
@@ -129,33 +128,11 @@ export declare enum IntegrationVersion {
|
|
|
129
128
|
NONE = "MVVM",
|
|
130
129
|
POLICY = "POLICY",
|
|
131
130
|
OFFER_STUB = "OFFER_STUB",
|
|
132
|
-
DIRECT = "DIRECT",
|
|
133
131
|
WEB = "WEB",
|
|
134
132
|
WEB_DIRECT = "WEB_DIRECT",
|
|
135
133
|
BANNER = "BANNER",
|
|
136
134
|
PWA = "PWA"
|
|
137
135
|
}
|
|
138
|
-
export interface IntegrationAlterations {
|
|
139
|
-
networkTool: AlternativeNetworkTool;
|
|
140
|
-
logicType: AlternativeLogicType;
|
|
141
|
-
navigation: AlternativeNavigation;
|
|
142
|
-
storageType: AlternativeStorageType;
|
|
143
|
-
sourceType: AlternativeSourceType;
|
|
144
|
-
onBackPressed: AlternativeOnBackPressed;
|
|
145
|
-
onActivityResult: AlternativeOnActivityResult;
|
|
146
|
-
layoutType: AlternativeLayoutType;
|
|
147
|
-
fullscreen: AlternativeFullscreen;
|
|
148
|
-
}
|
|
149
|
-
export interface IAppGenerationOptions {
|
|
150
|
-
splashName: string;
|
|
151
|
-
webViewName: string;
|
|
152
|
-
linkName: string;
|
|
153
|
-
}
|
|
154
|
-
export interface IDeveloperParams {
|
|
155
|
-
name: string;
|
|
156
|
-
email: string;
|
|
157
|
-
organization: string;
|
|
158
|
-
}
|
|
159
136
|
export interface IAppKeitaroData {
|
|
160
137
|
trackingCampaignId: number;
|
|
161
138
|
trackingCampaignName: string;
|
|
@@ -178,7 +155,6 @@ export declare const AppSchema: mongoose.Schema<any, mongoose.Model<any, any, an
|
|
|
178
155
|
bundle: string;
|
|
179
156
|
trackingUrl: string;
|
|
180
157
|
integrationVersion: string;
|
|
181
|
-
geos: string;
|
|
182
158
|
name?: string | null | undefined;
|
|
183
159
|
pushesEnabled?: boolean | null | undefined;
|
|
184
160
|
removeDataParams?: any;
|
|
@@ -217,7 +193,6 @@ export declare const AppSchema: mongoose.Schema<any, mongoose.Model<any, any, an
|
|
|
217
193
|
bundle: string;
|
|
218
194
|
trackingUrl: string;
|
|
219
195
|
integrationVersion: string;
|
|
220
|
-
geos: string;
|
|
221
196
|
name?: string | null | undefined;
|
|
222
197
|
pushesEnabled?: boolean | null | undefined;
|
|
223
198
|
removeDataParams?: any;
|
|
@@ -256,7 +231,6 @@ export declare const AppSchema: mongoose.Schema<any, mongoose.Model<any, any, an
|
|
|
256
231
|
bundle: string;
|
|
257
232
|
trackingUrl: string;
|
|
258
233
|
integrationVersion: string;
|
|
259
|
-
geos: string;
|
|
260
234
|
name?: string | null | undefined;
|
|
261
235
|
pushesEnabled?: boolean | null | undefined;
|
|
262
236
|
removeDataParams?: any;
|
package/lib/app/app.js
CHANGED
|
@@ -49,7 +49,6 @@ var IntegrationVersion;
|
|
|
49
49
|
IntegrationVersion["NONE"] = "MVVM";
|
|
50
50
|
IntegrationVersion["POLICY"] = "POLICY";
|
|
51
51
|
IntegrationVersion["OFFER_STUB"] = "OFFER_STUB";
|
|
52
|
-
IntegrationVersion["DIRECT"] = "DIRECT";
|
|
53
52
|
IntegrationVersion["WEB"] = "WEB";
|
|
54
53
|
IntegrationVersion["WEB_DIRECT"] = "WEB_DIRECT";
|
|
55
54
|
IntegrationVersion["BANNER"] = "BANNER";
|
|
@@ -103,10 +102,6 @@ exports.AppSchema = new mongoose_1.Schema({
|
|
|
103
102
|
enum: app_type_1.AppType,
|
|
104
103
|
default: app_type_1.AppType.GAMBLING
|
|
105
104
|
},
|
|
106
|
-
geos: {
|
|
107
|
-
type: String,
|
|
108
|
-
required: true
|
|
109
|
-
},
|
|
110
105
|
geo: {
|
|
111
106
|
type: [String]
|
|
112
107
|
},
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { IPush } from "./general/push";
|
|
|
2
2
|
export { IOffer, IPartner, IOfferType } from "./offers/offer";
|
|
3
3
|
export { IOffersSection, OffersSectionSchema, DefaultSectionId } from "./offers/section";
|
|
4
4
|
export { IAppOffersSection, ISectionsList, SectionsListSchema, IOfferState } from "./offers/list";
|
|
5
|
-
export {
|
|
5
|
+
export { IAdjustEventIds, IntegrationVersion, IApp, AppSchema, PlugType, IAppKeitaroData, IExternalParams, IPlatformParams, EPlatform } from "./app/app";
|
|
6
6
|
export { IAppListItem } from "./app/app-list-item";
|
|
7
7
|
export { AppType } from "./app/app-type";
|
|
8
8
|
export { AlternativeLayoutType, AlternativeSourceType, AlternativeLogicType, AlternativeNetworkTool, AlternativeStorageType, AlternativeNavigation, AlternativeOnBackPressed, AlternativeOnActivityResult, IAppIntegration as IFlashIntegration } from "./app/app-integration";
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { IKeitaroStream } from "../keitaro/keitaro-stream";
|
|
2
1
|
import { EPlatform, IApp } from "../app/app";
|
|
3
2
|
import { IKeitaroCampaign, IKeitaroCampaignParameters } from "../keitaro/keitaro-campaign";
|
|
4
3
|
export declare const TRAFFIC_SOURCE_ID_FLASH_AI = 22;
|
|
5
4
|
export declare let addGeosToAllRedirectCampaigns: (geosToAdd: string) => Promise<void>;
|
|
6
5
|
export declare let removeGeosFromAllRedirectCampaigns: (geoToRemove: string) => Promise<void>;
|
|
7
6
|
export declare let prepareOWCampaignParameters: (app: IApp) => IKeitaroCampaignParameters;
|
|
8
|
-
export declare function createOWStreamPartialPayload(app: IApp): Partial<IKeitaroStream>;
|
|
9
7
|
export declare function createDirectCampaign(app: IApp): Promise<IKeitaroCampaign>;
|
|
10
8
|
export declare function createOWCampaign(app: IApp, platform?: EPlatform): Promise<any>;
|
|
11
9
|
type PostbackStatus = 'lead' | 'sale' | 'rejected';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.sendPostbacks = exports.createOWCampaign = exports.createDirectCampaign = exports.
|
|
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
8
|
const sleep = require('sleep-promise');
|
|
9
9
|
const axios_1 = __importDefault(require("axios"));
|
|
@@ -310,27 +310,27 @@ let prepareOWCampaignParameters = (app) => {
|
|
|
310
310
|
};
|
|
311
311
|
};
|
|
312
312
|
exports.prepareOWCampaignParameters = prepareOWCampaignParameters;
|
|
313
|
-
function createBPStreamPartialPayload(app) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
313
|
+
// function createBPStreamPartialPayload(app: IApp): Partial<IKeitaroStream> {
|
|
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
334
|
function createDefenceMainStreamPartialPayload(app) {
|
|
335
335
|
return {
|
|
336
336
|
name: "ALL",
|
|
@@ -343,24 +343,23 @@ function createDefenceMainStreamPartialPayload(app) {
|
|
|
343
343
|
weight: 100,
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
|
-
function createOWStreamPartialPayload(app) {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
exports.createOWStreamPartialPayload = createOWStreamPartialPayload;
|
|
346
|
+
// export function createOWStreamPartialPayload(app: IApp): Partial<IKeitaroStream> {
|
|
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
|
+
// }
|
|
364
363
|
async function createDirectCampaign(app) {
|
|
365
364
|
let campaign = await keitaro_service_1.KeitaroService.cloneDCampaign(app);
|
|
366
365
|
let stream = createDefenceMainStreamPartialPayload(app);
|
package/package.json
CHANGED
package/src/app/app.ts
CHANGED
|
@@ -14,8 +14,7 @@ export interface IApp extends Document {
|
|
|
14
14
|
pushesEnabled?: boolean
|
|
15
15
|
policyUrl?: string
|
|
16
16
|
type: AppType
|
|
17
|
-
|
|
18
|
-
geo: string[] // new one, actual
|
|
17
|
+
geo: string[]
|
|
19
18
|
|
|
20
19
|
onesignalAppId: string
|
|
21
20
|
onesignalRestApiKey: string
|
|
@@ -25,7 +24,6 @@ export interface IApp extends Document {
|
|
|
25
24
|
|
|
26
25
|
webInterfaceName: string
|
|
27
26
|
|
|
28
|
-
generationOptions: IAppGenerationOptions
|
|
29
27
|
keitaroData: IAppKeitaroData | null
|
|
30
28
|
integrationVersion: IntegrationVersion
|
|
31
29
|
|
|
@@ -86,12 +84,15 @@ export const getPlatformName = (platform: EPlatform | undefined): string | false
|
|
|
86
84
|
export interface IPlatformParams {
|
|
87
85
|
enabled: boolean,
|
|
88
86
|
geo: string[],
|
|
89
|
-
customCampaignData?: IAppKeitaroData,
|
|
90
87
|
trackingUrl?: string,
|
|
91
88
|
adjustParams?: {
|
|
92
89
|
appId: string,
|
|
93
90
|
eventIds: IAdjustEventIds,
|
|
94
91
|
},
|
|
92
|
+
direct?: {
|
|
93
|
+
enabled: boolean,
|
|
94
|
+
keitaroData: IAppKeitaroData | boolean
|
|
95
|
+
},
|
|
95
96
|
metricaParams?: {
|
|
96
97
|
appId: number,
|
|
97
98
|
postApiKey: string,
|
|
@@ -176,37 +177,12 @@ export enum IntegrationVersion {
|
|
|
176
177
|
NONE = "MVVM",
|
|
177
178
|
POLICY = "POLICY",
|
|
178
179
|
OFFER_STUB = "OFFER_STUB",
|
|
179
|
-
DIRECT = "DIRECT",
|
|
180
180
|
WEB = "WEB",
|
|
181
181
|
WEB_DIRECT = "WEB_DIRECT",
|
|
182
182
|
BANNER = "BANNER",
|
|
183
183
|
PWA = "PWA"
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
export interface IntegrationAlterations {
|
|
187
|
-
networkTool: AlternativeNetworkTool, // Network
|
|
188
|
-
logicType: AlternativeLogicType, // Logic
|
|
189
|
-
navigation: AlternativeNavigation, // Navigation
|
|
190
|
-
storageType: AlternativeStorageType, // Storage
|
|
191
|
-
sourceType: AlternativeSourceType, // Source
|
|
192
|
-
onBackPressed: AlternativeOnBackPressed,
|
|
193
|
-
onActivityResult: AlternativeOnActivityResult,
|
|
194
|
-
layoutType: AlternativeLayoutType,
|
|
195
|
-
fullscreen: AlternativeFullscreen
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export interface IAppGenerationOptions {
|
|
199
|
-
splashName: string
|
|
200
|
-
webViewName: string
|
|
201
|
-
linkName: string,
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export interface IDeveloperParams {
|
|
205
|
-
name: string
|
|
206
|
-
email: string
|
|
207
|
-
organization: string
|
|
208
|
-
}
|
|
209
|
-
|
|
210
186
|
export interface IAppKeitaroData {
|
|
211
187
|
trackingCampaignId: number
|
|
212
188
|
trackingCampaignName: string
|
|
@@ -265,10 +241,6 @@ export const AppSchema = new Schema({
|
|
|
265
241
|
enum: AppType,
|
|
266
242
|
default: AppType.GAMBLING
|
|
267
243
|
},
|
|
268
|
-
geos: {
|
|
269
|
-
type: String,
|
|
270
|
-
required: true
|
|
271
|
-
},
|
|
272
244
|
geo: {
|
|
273
245
|
type: [String]
|
|
274
246
|
},
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { IOffer, IPartner, IOfferType } from "./offers/offer"
|
|
|
4
4
|
export { IOffersSection, OffersSectionSchema, DefaultSectionId } from "./offers/section"
|
|
5
5
|
export { IAppOffersSection, ISectionsList, SectionsListSchema, IOfferState } from "./offers/list"
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { IAdjustEventIds, IntegrationVersion, IApp, AppSchema, PlugType, IAppKeitaroData, IExternalParams, IPlatformParams, EPlatform } from "./app/app"
|
|
8
8
|
export { IAppListItem } from "./app/app-list-item"
|
|
9
9
|
export { AppType } from "./app/app-type"
|
|
10
10
|
export { AlternativeLayoutType, AlternativeSourceType, AlternativeLogicType, AlternativeNetworkTool, AlternativeStorageType, AlternativeNavigation, AlternativeOnBackPressed, AlternativeOnActivityResult, IAppIntegration as IFlashIntegration } from "./app/app-integration"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EImageFormat,
|
|
1
|
+
import { EImageFormat, IAppKeitaroData, IBannerParams, IDirectParams, IDomainParams, IExternalParams, IOffersStubParams, IPlatformParams, IPrivacyPolicyParams, IRemoteServerParams, IRemoveDataParams, IntegrationVersion } from "app/app"
|
|
2
2
|
import { PlugType } from "index"
|
|
3
3
|
|
|
4
4
|
export interface IUpsertAppRequest {
|
|
@@ -345,27 +345,27 @@ export let prepareOWCampaignParameters = (app: IApp): IKeitaroCampaignParameters
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
function createBPStreamPartialPayload(app: IApp): Partial<IKeitaroStream> {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
348
|
+
// function createBPStreamPartialPayload(app: IApp): Partial<IKeitaroStream> {
|
|
349
|
+
// return {
|
|
350
|
+
// name: `Bot Protection`,
|
|
351
|
+
// type: "forced",
|
|
352
|
+
// action_type: "http",
|
|
353
|
+
// action_payload: "https://tomain.com",
|
|
354
|
+
// schema: "redirect",
|
|
355
|
+
// filter_or: true,
|
|
356
|
+
// collect_clicks: true,
|
|
357
|
+
// weight: 0,
|
|
358
|
+
// filters: [{
|
|
359
|
+
// name: "country",
|
|
360
|
+
// mode: "reject",
|
|
361
|
+
// payload: app.geos.split(" ")
|
|
362
|
+
// }, {
|
|
363
|
+
// name: "bot",
|
|
364
|
+
// mode: "accept",
|
|
365
|
+
// payload: null,
|
|
366
|
+
// }],
|
|
367
|
+
// }
|
|
368
|
+
// }
|
|
369
369
|
|
|
370
370
|
function createDefenceMainStreamPartialPayload(app: IApp): Partial<IKeitaroStream> {
|
|
371
371
|
return {
|
|
@@ -380,23 +380,23 @@ function createDefenceMainStreamPartialPayload(app: IApp): Partial<IKeitaroStrea
|
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
-
export function createOWStreamPartialPayload(app: IApp): Partial<IKeitaroStream> {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
}
|
|
383
|
+
// export function createOWStreamPartialPayload(app: IApp): Partial<IKeitaroStream> {
|
|
384
|
+
// return {
|
|
385
|
+
// name: `OW`,
|
|
386
|
+
// type: "regular",
|
|
387
|
+
// action_type: "http",
|
|
388
|
+
// action_payload: "https://bprtsk-controlpanel.com/ow?appId={appId}&clickId={uid}&countryCode={country}",
|
|
389
|
+
// schema: "redirect",
|
|
390
|
+
// filter_or: false,
|
|
391
|
+
// collect_clicks: true,
|
|
392
|
+
// weight: 100,
|
|
393
|
+
// filters: [{
|
|
394
|
+
// name: "country",
|
|
395
|
+
// mode: "accept",
|
|
396
|
+
// payload: app.geos.split(" ")
|
|
397
|
+
// }],
|
|
398
|
+
// }
|
|
399
|
+
// }
|
|
400
400
|
|
|
401
401
|
export async function createDirectCampaign(app: IApp) {
|
|
402
402
|
let campaign = await KeitaroService.cloneDCampaign(app)
|