@bprotsyk/aso-core 2.1.224 → 2.1.225
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 +237 -363
- package/lib/app/app.js +93 -176
- package/lib/general/cloudflare-domain.d.ts +1 -0
- package/lib/general/domain.d.ts +82 -0
- package/lib/general/domain.js +5 -0
- package/lib/index.d.ts +5 -2
- package/lib/index.js +21 -17
- package/lib/keitaro/keitaro-campaign.d.ts +0 -1
- package/lib/keitaro/keitaro-offer.d.ts +3 -14
- package/lib/network/keitaro/http.js +1 -1
- package/lib/network/keitaro/keitaro-service.d.ts +37 -51
- package/lib/network/keitaro/keitaro-service.js +442 -192
- package/lib/offers/list.d.ts +18 -18
- package/lib/offers/offer.d.ts +4 -0
- package/lib/offers/offer.js +1 -0
- package/lib/panel/app/upsert-flash-app-request.d.ts +14 -14
- package/lib/server/server.d.ts +140 -0
- package/lib/server/server.js +36 -0
- package/lib/utils/keitaro-utils.d.ts +1 -1
- package/lib/utils/keitaro-utils.js +9 -722
- package/package.json +1 -1
- package/src/app/app.ts +316 -308
- package/src/general/cloudflare-domain.ts +1 -0
- package/src/general/domain.ts +8 -0
- package/src/index.ts +27 -30
- package/src/keitaro/keitaro-campaign.ts +0 -1
- package/src/keitaro/keitaro-offer.ts +3 -14
- package/src/network/keitaro/http.ts +1 -1
- package/src/network/keitaro/keitaro-service.ts +533 -232
- package/src/offers/offer.ts +2 -0
- package/src/panel/app/upsert-flash-app-request.ts +48 -0
- package/src/server/server.ts +57 -0
- package/src/utils/keitaro-utils.ts +24 -0
package/src/offers/offer.ts
CHANGED
|
@@ -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,48 @@
|
|
|
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
|
+
geos?: string[]
|
|
23
|
+
|
|
24
|
+
campaign?: Partial<IAppCampaign>
|
|
25
|
+
appsflyerParams?: IAppsflyerParams
|
|
26
|
+
adjustParams?: IAdjustParams
|
|
27
|
+
|
|
28
|
+
offerwallParams?: IOfferwallParams
|
|
29
|
+
domainParams: IDomainParams
|
|
30
|
+
|
|
31
|
+
policyPath?: string
|
|
32
|
+
postbacks?: IAppsflyerPostback[]
|
|
33
|
+
|
|
34
|
+
webviewConfig?: IWebviewConfig
|
|
35
|
+
serverId?: string
|
|
36
|
+
|
|
37
|
+
file?: any
|
|
38
|
+
|
|
39
|
+
// Campaign creation flags (not stored in DB)
|
|
40
|
+
createNewCampaign?: boolean
|
|
41
|
+
selectedOfferwallCampaignId?: number | null
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface IUpsertAppResponse {
|
|
45
|
+
data: IUpsertAppRequest
|
|
46
|
+
linkName: string
|
|
47
|
+
archive: string
|
|
48
|
+
}
|
|
@@ -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> {}
|