@bprotsyk/aso-core 2.1.224 → 2.1.226

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.
@@ -14,6 +14,7 @@ export interface IOffer extends Document {
14
14
  link: string,
15
15
  type: IOfferType,
16
16
  keitaroId: string | null,
17
+ generatedKey?: string,
17
18
  hidden?: boolean,
18
19
  history: {
19
20
  link: string[],
@@ -70,6 +71,7 @@ export const OfferSchema = new Schema({
70
71
  default: IOfferType.GAMBLING
71
72
  },
72
73
  keitaroId: String,
74
+ generatedKey: String,
73
75
  hidden: Boolean,
74
76
  history: {
75
77
  link: [String],
@@ -0,0 +1,49 @@
1
+ import {
2
+ AppMode,
3
+ AppStatus,
4
+ IAppCampaign,
5
+ IAdjustParams,
6
+ IAppsflyerParams,
7
+ IDomainParams,
8
+ IOfferwallParams,
9
+ IWebviewConfig,
10
+ IAppsflyerPostback,
11
+ } from "../../app/app";
12
+ import { AppType } from "../../app/app-type";
13
+
14
+ export interface IUpsertAppRequest {
15
+ id: number
16
+ name?: string
17
+ bundle?: string
18
+ enabled?: boolean
19
+ status?: AppStatus
20
+ appMode?: AppMode
21
+ appType?: AppType
22
+ appPlatform?: string
23
+ geos?: string[]
24
+
25
+ campaign?: Partial<IAppCampaign>
26
+ appsflyerParams?: IAppsflyerParams
27
+ adjustParams?: IAdjustParams
28
+
29
+ offerwallParams?: IOfferwallParams
30
+ domainParams: IDomainParams
31
+
32
+ policyPath?: string
33
+ postbacks?: IAppsflyerPostback[]
34
+
35
+ webviewConfig?: IWebviewConfig
36
+ serverId?: string
37
+
38
+ file?: any
39
+
40
+ // Campaign creation flags (not stored in DB)
41
+ createNewCampaign?: boolean
42
+ selectedOfferwallCampaignId?: number | null
43
+ }
44
+
45
+ export interface IUpsertAppResponse {
46
+ data: IUpsertAppRequest
47
+ linkName: string
48
+ archive: string
49
+ }
@@ -0,0 +1,57 @@
1
+ import { Schema, Document } from 'mongoose'
2
+
3
+ export type ServerProvider = 'ovh'
4
+
5
+ export enum ServerStatus {
6
+ PROVISIONING = 'provisioning',
7
+ ACTIVE = 'active',
8
+ ERROR = 'error',
9
+ TERMINATED = 'terminated',
10
+ }
11
+
12
+ export enum HelperAppStatus {
13
+ NOT_DEPLOYED = 'not_deployed',
14
+ DEPLOYING = 'deploying',
15
+ ACTIVE = 'active',
16
+ ERROR = 'error',
17
+ }
18
+
19
+ export interface IServerSlot {
20
+ ip: string
21
+ appId?: number
22
+ domain?: string
23
+ sslReady: boolean
24
+ }
25
+
26
+ export interface IServer extends Document {
27
+ provider: ServerProvider
28
+ ovhServiceId: string
29
+ mainIp: string
30
+ status: ServerStatus
31
+ hostname: string
32
+ region: string
33
+ helperAppStatus: HelperAppStatus
34
+ createdAt: Date
35
+ notes?: string
36
+ slots: IServerSlot[]
37
+ }
38
+
39
+ const ServerSlotSchema = new Schema({
40
+ ip: { type: String, required: true },
41
+ appId: { type: Number },
42
+ domain: { type: String },
43
+ sslReady: { type: Boolean, default: false },
44
+ }, { _id: false })
45
+
46
+ export const ServerSchema = new Schema({
47
+ provider: { type: String, default: 'ovh' },
48
+ ovhServiceId: { type: String, default: '' },
49
+ mainIp: { type: String, default: '' },
50
+ status: { type: String, enum: Object.values(ServerStatus), default: ServerStatus.PROVISIONING },
51
+ hostname: { type: String, default: '' },
52
+ region: { type: String, default: '' },
53
+ helperAppStatus: { type: String, enum: Object.values(HelperAppStatus), default: HelperAppStatus.NOT_DEPLOYED },
54
+ createdAt: { type: Date, default: Date.now },
55
+ notes: { type: String },
56
+ slots: { type: [ServerSlotSchema], default: [] },
57
+ })
@@ -0,0 +1,24 @@
1
+ import { EPlatform, IApp } from "../app/app"
2
+ import { IKeitaroCampaign, IKeitaroCampaignParameters } from "../keitaro/keitaro-campaign"
3
+ import keitaroApi from "../network/keitaro/http"
4
+
5
+ export const TRAFFIC_SOURCE_ID_FLASH_AI = 22
6
+ export const TRAFFIC_SOURCE_ID_DIRECT_AI = 23
7
+
8
+ export let prepareOWCampaignParameters = (app: IApp): IKeitaroCampaignParameters => {
9
+ return {}
10
+ }
11
+
12
+ export let addGeosToAllRedirectCampaigns = async (geosToAdd: string): Promise<void> => {}
13
+ export let removeGeosFromAllRedirectCampaigns = async (geoToRemove: string): Promise<void> => {}
14
+
15
+ export async function createDirectCampaign(app: IApp): Promise<IKeitaroCampaign> {
16
+ throw new Error('createDirectCampaign: not implemented')
17
+ }
18
+
19
+ export async function createOWCampaign(app: IApp, platform?: EPlatform): Promise<any> {
20
+ throw new Error('createOWCampaign: not implemented')
21
+ }
22
+
23
+ type PostbackStatus = 'lead' | 'sale' | 'rejected'
24
+ export async function sendPostbacks(subids: string[], status: PostbackStatus, payout?: number): Promise<void> {}