@bprotsyk/aso-core 2.1.54 → 2.1.55
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 +98 -15
- package/lib/app/app.js +24 -1
- package/lib/general/domain.d.ts +82 -23
- package/lib/general/namecheap-domain.d.ts +56 -9
- package/lib/network/keitaro/keitaro-service.d.ts +2 -2
- package/lib/network/keitaro/keitaro-service.js +12 -3
- package/lib/offers/list.d.ts +400 -2
- package/lib/offers/offer.d.ts +79 -18
- package/lib/offers/section.d.ts +14 -1
- package/lib/panel/user.d.ts +16 -3
- package/package.json +2 -2
- package/src/app/app.ts +24 -0
- package/src/network/keitaro/keitaro-service.ts +20 -4
- package/test-keitaro.js +1 -1
package/lib/app/app.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export declare enum EPlatform {
|
|
|
49
49
|
TELEGRAM = "tg",
|
|
50
50
|
AMAZON = "am"
|
|
51
51
|
}
|
|
52
|
+
export declare const getPlatformName: (platform: EPlatform | undefined) => string | false;
|
|
52
53
|
export interface IPlatformParams {
|
|
53
54
|
enabled: boolean;
|
|
54
55
|
geo: string[];
|
|
@@ -166,7 +167,7 @@ export declare enum PlugType {
|
|
|
166
167
|
GIST = "GIST",
|
|
167
168
|
OTHER = "OTHER"
|
|
168
169
|
}
|
|
169
|
-
export declare const AppSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
|
|
170
|
+
export declare const AppSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
|
|
170
171
|
id: number;
|
|
171
172
|
type: string;
|
|
172
173
|
geo: string[];
|
|
@@ -177,32 +178,114 @@ export declare const AppSchema: mongoose.Schema<any, mongoose.Model<any, any, an
|
|
|
177
178
|
trackingUrl: string;
|
|
178
179
|
integrationVersion: string;
|
|
179
180
|
geos: string;
|
|
180
|
-
name?: string | undefined;
|
|
181
|
-
pushesEnabled?: boolean | undefined;
|
|
181
|
+
name?: string | null | undefined;
|
|
182
|
+
pushesEnabled?: boolean | null | undefined;
|
|
182
183
|
removeDataParams?: any;
|
|
183
184
|
privacyPolicyParams?: any;
|
|
184
185
|
offersStubParams?: any;
|
|
185
186
|
bannerParams?: any;
|
|
186
187
|
directParams?: any;
|
|
187
188
|
platforms?: any;
|
|
188
|
-
onesignalAppId?: string | undefined;
|
|
189
|
-
onesignalRestApiKey?: string | undefined;
|
|
190
|
-
appmetricaApiKey?: string | undefined;
|
|
191
|
-
appmetricaAppId?: number | undefined;
|
|
189
|
+
onesignalAppId?: string | null | undefined;
|
|
190
|
+
onesignalRestApiKey?: string | null | undefined;
|
|
191
|
+
appmetricaApiKey?: string | null | undefined;
|
|
192
|
+
appmetricaAppId?: number | null | undefined;
|
|
192
193
|
externalParams?: {
|
|
193
|
-
schema?: string | undefined;
|
|
194
|
-
showButton?: boolean | undefined;
|
|
195
|
-
autoRedirect?: boolean | undefined;
|
|
196
|
-
} | undefined;
|
|
194
|
+
schema?: string | null | undefined;
|
|
195
|
+
showButton?: boolean | null | undefined;
|
|
196
|
+
autoRedirect?: boolean | null | undefined;
|
|
197
|
+
} | null | undefined;
|
|
197
198
|
keitaroData?: {
|
|
198
199
|
trackingCampaignId: number;
|
|
199
200
|
trackingCampaignName: string;
|
|
200
201
|
trackingCampaignAlias: string;
|
|
201
202
|
trackingDomainId: number;
|
|
202
203
|
trackingDomainName: string;
|
|
203
|
-
} | undefined;
|
|
204
|
+
} | null | undefined;
|
|
204
205
|
domainParams?: {
|
|
205
|
-
name?: string | undefined;
|
|
206
|
-
clouflareZone?: string | undefined;
|
|
207
|
-
} | undefined;
|
|
206
|
+
name?: string | null | undefined;
|
|
207
|
+
clouflareZone?: string | null | undefined;
|
|
208
|
+
} | null | undefined;
|
|
209
|
+
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
210
|
+
id: number;
|
|
211
|
+
type: string;
|
|
212
|
+
geo: string[];
|
|
213
|
+
enabled: boolean;
|
|
214
|
+
proxied: boolean;
|
|
215
|
+
imageFormat: string;
|
|
216
|
+
bundle: string;
|
|
217
|
+
trackingUrl: string;
|
|
218
|
+
integrationVersion: string;
|
|
219
|
+
geos: string;
|
|
220
|
+
name?: string | null | undefined;
|
|
221
|
+
pushesEnabled?: boolean | null | undefined;
|
|
222
|
+
removeDataParams?: any;
|
|
223
|
+
privacyPolicyParams?: any;
|
|
224
|
+
offersStubParams?: any;
|
|
225
|
+
bannerParams?: any;
|
|
226
|
+
directParams?: any;
|
|
227
|
+
platforms?: any;
|
|
228
|
+
onesignalAppId?: string | null | undefined;
|
|
229
|
+
onesignalRestApiKey?: string | null | undefined;
|
|
230
|
+
appmetricaApiKey?: string | null | undefined;
|
|
231
|
+
appmetricaAppId?: number | null | undefined;
|
|
232
|
+
externalParams?: {
|
|
233
|
+
schema?: string | null | undefined;
|
|
234
|
+
showButton?: boolean | null | undefined;
|
|
235
|
+
autoRedirect?: boolean | null | undefined;
|
|
236
|
+
} | null | undefined;
|
|
237
|
+
keitaroData?: {
|
|
238
|
+
trackingCampaignId: number;
|
|
239
|
+
trackingCampaignName: string;
|
|
240
|
+
trackingCampaignAlias: string;
|
|
241
|
+
trackingDomainId: number;
|
|
242
|
+
trackingDomainName: string;
|
|
243
|
+
} | null | undefined;
|
|
244
|
+
domainParams?: {
|
|
245
|
+
name?: string | null | undefined;
|
|
246
|
+
clouflareZone?: string | null | undefined;
|
|
247
|
+
} | null | undefined;
|
|
248
|
+
}>> & mongoose.FlatRecord<{
|
|
249
|
+
id: number;
|
|
250
|
+
type: string;
|
|
251
|
+
geo: string[];
|
|
252
|
+
enabled: boolean;
|
|
253
|
+
proxied: boolean;
|
|
254
|
+
imageFormat: string;
|
|
255
|
+
bundle: string;
|
|
256
|
+
trackingUrl: string;
|
|
257
|
+
integrationVersion: string;
|
|
258
|
+
geos: string;
|
|
259
|
+
name?: string | null | undefined;
|
|
260
|
+
pushesEnabled?: boolean | null | undefined;
|
|
261
|
+
removeDataParams?: any;
|
|
262
|
+
privacyPolicyParams?: any;
|
|
263
|
+
offersStubParams?: any;
|
|
264
|
+
bannerParams?: any;
|
|
265
|
+
directParams?: any;
|
|
266
|
+
platforms?: any;
|
|
267
|
+
onesignalAppId?: string | null | undefined;
|
|
268
|
+
onesignalRestApiKey?: string | null | undefined;
|
|
269
|
+
appmetricaApiKey?: string | null | undefined;
|
|
270
|
+
appmetricaAppId?: number | null | undefined;
|
|
271
|
+
externalParams?: {
|
|
272
|
+
schema?: string | null | undefined;
|
|
273
|
+
showButton?: boolean | null | undefined;
|
|
274
|
+
autoRedirect?: boolean | null | undefined;
|
|
275
|
+
} | null | undefined;
|
|
276
|
+
keitaroData?: {
|
|
277
|
+
trackingCampaignId: number;
|
|
278
|
+
trackingCampaignName: string;
|
|
279
|
+
trackingCampaignAlias: string;
|
|
280
|
+
trackingDomainId: number;
|
|
281
|
+
trackingDomainName: string;
|
|
282
|
+
} | null | undefined;
|
|
283
|
+
domainParams?: {
|
|
284
|
+
name?: string | null | undefined;
|
|
285
|
+
clouflareZone?: string | null | undefined;
|
|
286
|
+
} | null | undefined;
|
|
287
|
+
}> & {
|
|
288
|
+
_id: mongoose.Types.ObjectId;
|
|
289
|
+
} & {
|
|
290
|
+
__v: number;
|
|
208
291
|
}>;
|
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.EPlatform = exports.EImageFormat = void 0;
|
|
3
|
+
exports.AppSchema = exports.PlugType = exports.IntegrationVersion = exports.getPlatformName = 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");
|
|
@@ -21,6 +21,29 @@ var EPlatform;
|
|
|
21
21
|
EPlatform["TELEGRAM"] = "tg";
|
|
22
22
|
EPlatform["AMAZON"] = "am";
|
|
23
23
|
})(EPlatform = exports.EPlatform || (exports.EPlatform = {}));
|
|
24
|
+
const getPlatformName = (platform) => {
|
|
25
|
+
switch (platform) {
|
|
26
|
+
case EPlatform.SAMSUNG:
|
|
27
|
+
return "samsung";
|
|
28
|
+
case EPlatform.HUAWEI:
|
|
29
|
+
return "huawei";
|
|
30
|
+
case EPlatform.ruSTORE:
|
|
31
|
+
return "ruStore";
|
|
32
|
+
case EPlatform.XIAOMI:
|
|
33
|
+
return "xiaomi";
|
|
34
|
+
case EPlatform.APKPURE:
|
|
35
|
+
return "apkpure";
|
|
36
|
+
case EPlatform.TELEGRAM:
|
|
37
|
+
return "telegram";
|
|
38
|
+
case EPlatform.AMAZON:
|
|
39
|
+
return "amazon";
|
|
40
|
+
case EPlatform.GENERAL:
|
|
41
|
+
return false;
|
|
42
|
+
default:
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.getPlatformName = getPlatformName;
|
|
24
47
|
var IntegrationVersion;
|
|
25
48
|
(function (IntegrationVersion) {
|
|
26
49
|
IntegrationVersion["NONE"] = "MVVM";
|
package/lib/general/domain.d.ts
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
25
26
|
import { ICloudflareDomainType } from "general/cloudflare-domain";
|
|
26
27
|
import { Document, Model, Schema } from "mongoose";
|
|
27
28
|
export interface IDomain extends Document {
|
|
@@ -80,31 +81,89 @@ export declare enum DomainTarget {
|
|
|
80
81
|
UNKNOWN = "unknown"
|
|
81
82
|
}
|
|
82
83
|
export declare let getDomainTargetByIp: (ip: string) => DomainTarget;
|
|
83
|
-
export declare const DomainSchema: Schema<any, Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
84
|
+
export declare const DomainSchema: Schema<any, Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
84
85
|
nameServers: string[];
|
|
85
86
|
originalNameServers: string[];
|
|
86
87
|
txtRecords: string[];
|
|
87
88
|
assignedTo: number[];
|
|
88
|
-
id?: string | undefined;
|
|
89
|
-
name?: string | undefined;
|
|
90
|
-
type?: string | undefined;
|
|
91
|
-
caption?: string | undefined;
|
|
92
|
-
title?: string | undefined;
|
|
93
|
-
proxied?: boolean | undefined;
|
|
94
|
-
ip?: string | undefined;
|
|
95
|
-
namecheapId?: string | undefined;
|
|
96
|
-
status?: string | undefined;
|
|
97
|
-
isUpdating?: boolean | undefined;
|
|
98
|
-
cloudflareStatus?: string | undefined;
|
|
99
|
-
paused?: boolean | undefined;
|
|
100
|
-
originalRegistrar?: string | undefined;
|
|
101
|
-
originalDNSHost?: string | undefined;
|
|
102
|
-
createdAt?: number | undefined;
|
|
103
|
-
expiresAt?: number | undefined;
|
|
104
|
-
subdomain?: string | undefined;
|
|
105
|
-
mxRecord?: string | undefined;
|
|
106
|
-
target?: string | undefined;
|
|
107
|
-
archived?: boolean | undefined;
|
|
108
|
-
note?: string | undefined;
|
|
109
|
-
appid?: number | undefined;
|
|
89
|
+
id?: string | null | undefined;
|
|
90
|
+
name?: string | null | undefined;
|
|
91
|
+
type?: string | null | undefined;
|
|
92
|
+
caption?: string | null | undefined;
|
|
93
|
+
title?: string | null | undefined;
|
|
94
|
+
proxied?: boolean | null | undefined;
|
|
95
|
+
ip?: string | null | undefined;
|
|
96
|
+
namecheapId?: string | null | undefined;
|
|
97
|
+
status?: string | null | undefined;
|
|
98
|
+
isUpdating?: boolean | null | undefined;
|
|
99
|
+
cloudflareStatus?: string | null | undefined;
|
|
100
|
+
paused?: boolean | null | undefined;
|
|
101
|
+
originalRegistrar?: string | null | undefined;
|
|
102
|
+
originalDNSHost?: string | null | undefined;
|
|
103
|
+
createdAt?: number | null | undefined;
|
|
104
|
+
expiresAt?: number | null | undefined;
|
|
105
|
+
subdomain?: string | null | undefined;
|
|
106
|
+
mxRecord?: string | null | undefined;
|
|
107
|
+
target?: string | null | undefined;
|
|
108
|
+
archived?: boolean | null | undefined;
|
|
109
|
+
note?: string | null | undefined;
|
|
110
|
+
appid?: number | null | undefined;
|
|
111
|
+
}, Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
112
|
+
nameServers: string[];
|
|
113
|
+
originalNameServers: string[];
|
|
114
|
+
txtRecords: string[];
|
|
115
|
+
assignedTo: number[];
|
|
116
|
+
id?: string | null | undefined;
|
|
117
|
+
name?: string | null | undefined;
|
|
118
|
+
type?: string | null | undefined;
|
|
119
|
+
caption?: string | null | undefined;
|
|
120
|
+
title?: string | null | undefined;
|
|
121
|
+
proxied?: boolean | null | undefined;
|
|
122
|
+
ip?: string | null | undefined;
|
|
123
|
+
namecheapId?: string | null | undefined;
|
|
124
|
+
status?: string | null | undefined;
|
|
125
|
+
isUpdating?: boolean | null | undefined;
|
|
126
|
+
cloudflareStatus?: string | null | undefined;
|
|
127
|
+
paused?: boolean | null | undefined;
|
|
128
|
+
originalRegistrar?: string | null | undefined;
|
|
129
|
+
originalDNSHost?: string | null | undefined;
|
|
130
|
+
createdAt?: number | null | undefined;
|
|
131
|
+
expiresAt?: number | null | undefined;
|
|
132
|
+
subdomain?: string | null | undefined;
|
|
133
|
+
mxRecord?: string | null | undefined;
|
|
134
|
+
target?: string | null | undefined;
|
|
135
|
+
archived?: boolean | null | undefined;
|
|
136
|
+
note?: string | null | undefined;
|
|
137
|
+
appid?: number | null | undefined;
|
|
138
|
+
}>> & import("mongoose").FlatRecord<{
|
|
139
|
+
nameServers: string[];
|
|
140
|
+
originalNameServers: string[];
|
|
141
|
+
txtRecords: string[];
|
|
142
|
+
assignedTo: number[];
|
|
143
|
+
id?: string | null | undefined;
|
|
144
|
+
name?: string | null | undefined;
|
|
145
|
+
type?: string | null | undefined;
|
|
146
|
+
caption?: string | null | undefined;
|
|
147
|
+
title?: string | null | undefined;
|
|
148
|
+
proxied?: boolean | null | undefined;
|
|
149
|
+
ip?: string | null | undefined;
|
|
150
|
+
namecheapId?: string | null | undefined;
|
|
151
|
+
status?: string | null | undefined;
|
|
152
|
+
isUpdating?: boolean | null | undefined;
|
|
153
|
+
cloudflareStatus?: string | null | undefined;
|
|
154
|
+
paused?: boolean | null | undefined;
|
|
155
|
+
originalRegistrar?: string | null | undefined;
|
|
156
|
+
originalDNSHost?: string | null | undefined;
|
|
157
|
+
createdAt?: number | null | undefined;
|
|
158
|
+
expiresAt?: number | null | undefined;
|
|
159
|
+
subdomain?: string | null | undefined;
|
|
160
|
+
mxRecord?: string | null | undefined;
|
|
161
|
+
target?: string | null | undefined;
|
|
162
|
+
archived?: boolean | null | undefined;
|
|
163
|
+
note?: string | null | undefined;
|
|
164
|
+
appid?: number | null | undefined;
|
|
165
|
+
}> & {
|
|
166
|
+
_id: import("mongoose").Types.ObjectId;
|
|
167
|
+
} & {
|
|
168
|
+
__v: number;
|
|
110
169
|
}>;
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
25
26
|
import { Schema, Document } from "mongoose";
|
|
26
27
|
export interface INamecheapDomain {
|
|
27
28
|
ID: string;
|
|
@@ -73,13 +74,59 @@ export interface INamecheapBuyResult {
|
|
|
73
74
|
};
|
|
74
75
|
paidTotal: number;
|
|
75
76
|
}
|
|
76
|
-
export declare const NamecheapBuyRequestSchema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
77
|
-
domains: {
|
|
78
|
-
name?: string | undefined;
|
|
79
|
-
price?: number | undefined;
|
|
80
|
-
available?: boolean | undefined;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
export declare const NamecheapBuyRequestSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
78
|
+
domains: import("mongoose").Types.DocumentArray<{
|
|
79
|
+
name?: string | null | undefined;
|
|
80
|
+
price?: number | null | undefined;
|
|
81
|
+
available?: boolean | null | undefined;
|
|
82
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
83
|
+
name?: string | null | undefined;
|
|
84
|
+
price?: number | null | undefined;
|
|
85
|
+
available?: boolean | null | undefined;
|
|
86
|
+
}> & {
|
|
87
|
+
name?: string | null | undefined;
|
|
88
|
+
price?: number | null | undefined;
|
|
89
|
+
available?: boolean | null | undefined;
|
|
90
|
+
}>;
|
|
91
|
+
id?: string | null | undefined;
|
|
92
|
+
ip?: string | null | undefined;
|
|
93
|
+
fullfilled?: boolean | null | undefined;
|
|
94
|
+
}, Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
95
|
+
domains: import("mongoose").Types.DocumentArray<{
|
|
96
|
+
name?: string | null | undefined;
|
|
97
|
+
price?: number | null | undefined;
|
|
98
|
+
available?: boolean | null | undefined;
|
|
99
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
100
|
+
name?: string | null | undefined;
|
|
101
|
+
price?: number | null | undefined;
|
|
102
|
+
available?: boolean | null | undefined;
|
|
103
|
+
}> & {
|
|
104
|
+
name?: string | null | undefined;
|
|
105
|
+
price?: number | null | undefined;
|
|
106
|
+
available?: boolean | null | undefined;
|
|
107
|
+
}>;
|
|
108
|
+
id?: string | null | undefined;
|
|
109
|
+
ip?: string | null | undefined;
|
|
110
|
+
fullfilled?: boolean | null | undefined;
|
|
111
|
+
}>> & import("mongoose").FlatRecord<{
|
|
112
|
+
domains: import("mongoose").Types.DocumentArray<{
|
|
113
|
+
name?: string | null | undefined;
|
|
114
|
+
price?: number | null | undefined;
|
|
115
|
+
available?: boolean | null | undefined;
|
|
116
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
117
|
+
name?: string | null | undefined;
|
|
118
|
+
price?: number | null | undefined;
|
|
119
|
+
available?: boolean | null | undefined;
|
|
120
|
+
}> & {
|
|
121
|
+
name?: string | null | undefined;
|
|
122
|
+
price?: number | null | undefined;
|
|
123
|
+
available?: boolean | null | undefined;
|
|
124
|
+
}>;
|
|
125
|
+
id?: string | null | undefined;
|
|
126
|
+
ip?: string | null | undefined;
|
|
127
|
+
fullfilled?: boolean | null | undefined;
|
|
128
|
+
}> & {
|
|
129
|
+
_id: import("mongoose").Types.ObjectId;
|
|
130
|
+
} & {
|
|
131
|
+
__v: number;
|
|
85
132
|
}>;
|
|
@@ -2,7 +2,7 @@ import { IKeitaroStream } from "../../keitaro/keitaro-stream";
|
|
|
2
2
|
import { IOffer } from "../../offers/offer";
|
|
3
3
|
import { IKeitaroCampaign } from "../../keitaro/keitaro-campaign";
|
|
4
4
|
import { IKeitaroDomain } from "../../keitaro/keitaro-domain";
|
|
5
|
-
import { IApp } from "../../app/app";
|
|
5
|
+
import { EPlatform, IApp } from "../../app/app";
|
|
6
6
|
import { IKeitaroOffer } from "index";
|
|
7
7
|
import { IKeitaroClicksRequest, KeitaroClicksInterval } from "../../keitaro/keitaro-clicks";
|
|
8
8
|
export interface IKeitaroOffersFilter {
|
|
@@ -22,7 +22,7 @@ declare function addOffersToKeitaro(offers: IOffer[], affiliateId: number, links
|
|
|
22
22
|
declare function createCampaign(campaignData: Partial<IKeitaroCampaign>): Promise<IKeitaroCampaign>;
|
|
23
23
|
declare function getCampaignById(id: number): Promise<IKeitaroCampaign>;
|
|
24
24
|
export declare function upsertStreamToCampaign(campaign: IKeitaroCampaign, stream: Partial<IKeitaroStream>): Promise<void>;
|
|
25
|
-
declare function cloneOWCampaign(app: IApp): Promise<IKeitaroCampaign | any>;
|
|
25
|
+
declare function cloneOWCampaign(app: IApp, platform?: EPlatform): Promise<IKeitaroCampaign | any>;
|
|
26
26
|
declare function cloneDCampaign(app: IApp): Promise<IKeitaroCampaign>;
|
|
27
27
|
declare function changeCampaignsGroup(fromId: number, toId: number, exceptForCampaignIds: number[], onlyForCampaignIds?: number[]): Promise<void>;
|
|
28
28
|
declare function getDomains(onlyActive?: boolean): Promise<IKeitaroDomain[]>;
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.KeitaroService = exports.upsertStreamToCampaign = void 0;
|
|
7
7
|
const http_1 = __importDefault(require("./http"));
|
|
8
|
+
const app_1 = require("../../app/app");
|
|
8
9
|
const keitaro_utils_1 = require("../../utils/keitaro-utils");
|
|
9
10
|
const general_1 = require("../../utils/general");
|
|
10
11
|
async function getStreamsByCampaignId(campaignId) {
|
|
@@ -191,14 +192,22 @@ async function upsertStreamToCampaign(campaign, stream) {
|
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
194
|
exports.upsertStreamToCampaign = upsertStreamToCampaign;
|
|
194
|
-
async function cloneOWCampaign(app) {
|
|
195
|
+
async function cloneOWCampaign(app, platform) {
|
|
195
196
|
let name = `#${app.id} [◈]`;
|
|
197
|
+
let platformName = platform ? (0, app_1.getPlatformName)(platform) : null;
|
|
198
|
+
const platformCampaignName = `#${app.id} [◈] (${platformName})`;
|
|
196
199
|
const generateAlias = () => {
|
|
197
200
|
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
|
198
201
|
return Array.from({ length: 8 }, () => chars.charAt(Math.floor(Math.random() * chars.length))).join('');
|
|
199
202
|
};
|
|
200
203
|
let allCampaigns = await getAllCampaigns();
|
|
201
|
-
let matchingCampaign =
|
|
204
|
+
let matchingCampaign = [];
|
|
205
|
+
if (platform) {
|
|
206
|
+
matchingCampaign = allCampaigns.filter((c) => c.name === `#${app.id} [◈] (${platformName})`);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
matchingCampaign = allCampaigns.filter((c) => c.name === `#${app.id} [◈]`);
|
|
210
|
+
}
|
|
202
211
|
if (matchingCampaign.length > 0)
|
|
203
212
|
return matchingCampaign[0];
|
|
204
213
|
const originalCampaign = await getCampaignById(2673);
|
|
@@ -213,7 +222,7 @@ async function cloneOWCampaign(app) {
|
|
|
213
222
|
let alias = generateAlias();
|
|
214
223
|
let payload = {
|
|
215
224
|
// Унікальні поля
|
|
216
|
-
name: name,
|
|
225
|
+
name: platformName ? platformCampaignName : name,
|
|
217
226
|
alias: alias,
|
|
218
227
|
domain_id: domain.id,
|
|
219
228
|
position: [maxPosition + 100],
|
package/lib/offers/list.d.ts
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
25
26
|
import { Schema } from "mongoose";
|
|
26
27
|
export interface ISectionsList {
|
|
27
28
|
id: number;
|
|
@@ -37,7 +38,404 @@ export interface IAppOffersSection {
|
|
|
37
38
|
[key: string]: IOfferState[];
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
|
-
export declare const SectionsListSchema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
41
|
+
export declare const SectionsListSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
41
42
|
id: number;
|
|
42
|
-
content:
|
|
43
|
+
content: import("mongoose").Types.DocumentArray<{
|
|
44
|
+
prototype?: {
|
|
45
|
+
constructor: {
|
|
46
|
+
name?: unknown;
|
|
47
|
+
[Symbol.hasInstance]?: {} | null | undefined;
|
|
48
|
+
prototype?: unknown;
|
|
49
|
+
length?: unknown;
|
|
50
|
+
caller?: any | null | undefined;
|
|
51
|
+
arguments?: unknown;
|
|
52
|
+
toString: {} | null;
|
|
53
|
+
apply?: {} | null | undefined;
|
|
54
|
+
call?: {} | null | undefined;
|
|
55
|
+
bind?: {} | null | undefined;
|
|
56
|
+
} | null;
|
|
57
|
+
toString: {} | null;
|
|
58
|
+
toLocaleString: {} | null;
|
|
59
|
+
valueOf: {} | null;
|
|
60
|
+
hasOwnProperty: {} | null;
|
|
61
|
+
isPrototypeOf: {} | null;
|
|
62
|
+
propertyIsEnumerable: {} | null;
|
|
63
|
+
} | null | undefined;
|
|
64
|
+
getPrototypeOf?: {} | null | undefined;
|
|
65
|
+
getOwnPropertyDescriptor?: {} | null | undefined;
|
|
66
|
+
getOwnPropertyNames?: {} | null | undefined;
|
|
67
|
+
create?: {} | null | undefined;
|
|
68
|
+
defineProperty?: {} | null | undefined;
|
|
69
|
+
defineProperties?: {} | null | undefined;
|
|
70
|
+
seal?: {} | null | undefined;
|
|
71
|
+
freeze?: {} | null | undefined;
|
|
72
|
+
preventExtensions?: {} | null | undefined;
|
|
73
|
+
isSealed?: {} | null | undefined;
|
|
74
|
+
isFrozen?: {} | null | undefined;
|
|
75
|
+
isExtensible?: {} | null | undefined;
|
|
76
|
+
keys?: {} | null | undefined;
|
|
77
|
+
assign?: {} | null | undefined;
|
|
78
|
+
getOwnPropertySymbols?: {} | null | undefined;
|
|
79
|
+
is?: {} | null | undefined;
|
|
80
|
+
setPrototypeOf?: {} | null | undefined;
|
|
81
|
+
values?: {} | null | undefined;
|
|
82
|
+
entries?: {} | null | undefined;
|
|
83
|
+
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
84
|
+
fromEntries?: {} | null | undefined;
|
|
85
|
+
hasOwn?: {} | null | undefined;
|
|
86
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
87
|
+
prototype?: {
|
|
88
|
+
constructor: {
|
|
89
|
+
name?: unknown;
|
|
90
|
+
[Symbol.hasInstance]?: {} | null | undefined;
|
|
91
|
+
prototype?: unknown;
|
|
92
|
+
length?: unknown;
|
|
93
|
+
caller?: any | null | undefined;
|
|
94
|
+
arguments?: unknown;
|
|
95
|
+
toString: {} | null;
|
|
96
|
+
apply?: {} | null | undefined;
|
|
97
|
+
call?: {} | null | undefined;
|
|
98
|
+
bind?: {} | null | undefined;
|
|
99
|
+
} | null;
|
|
100
|
+
toString: {} | null;
|
|
101
|
+
toLocaleString: {} | null;
|
|
102
|
+
valueOf: {} | null;
|
|
103
|
+
hasOwnProperty: {} | null;
|
|
104
|
+
isPrototypeOf: {} | null;
|
|
105
|
+
propertyIsEnumerable: {} | null;
|
|
106
|
+
} | null | undefined;
|
|
107
|
+
getPrototypeOf?: {} | null | undefined;
|
|
108
|
+
getOwnPropertyDescriptor?: {} | null | undefined;
|
|
109
|
+
getOwnPropertyNames?: {} | null | undefined;
|
|
110
|
+
create?: {} | null | undefined;
|
|
111
|
+
defineProperty?: {} | null | undefined;
|
|
112
|
+
defineProperties?: {} | null | undefined;
|
|
113
|
+
seal?: {} | null | undefined;
|
|
114
|
+
freeze?: {} | null | undefined;
|
|
115
|
+
preventExtensions?: {} | null | undefined;
|
|
116
|
+
isSealed?: {} | null | undefined;
|
|
117
|
+
isFrozen?: {} | null | undefined;
|
|
118
|
+
isExtensible?: {} | null | undefined;
|
|
119
|
+
keys?: {} | null | undefined;
|
|
120
|
+
assign?: {} | null | undefined;
|
|
121
|
+
getOwnPropertySymbols?: {} | null | undefined;
|
|
122
|
+
is?: {} | null | undefined;
|
|
123
|
+
setPrototypeOf?: {} | null | undefined;
|
|
124
|
+
values?: {} | null | undefined;
|
|
125
|
+
entries?: {} | null | undefined;
|
|
126
|
+
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
127
|
+
fromEntries?: {} | null | undefined;
|
|
128
|
+
hasOwn?: {} | null | undefined;
|
|
129
|
+
}> & {
|
|
130
|
+
prototype?: {
|
|
131
|
+
constructor: {
|
|
132
|
+
name?: unknown;
|
|
133
|
+
[Symbol.hasInstance]?: {} | null | undefined;
|
|
134
|
+
prototype?: unknown;
|
|
135
|
+
length?: unknown;
|
|
136
|
+
caller?: any | null | undefined;
|
|
137
|
+
arguments?: unknown;
|
|
138
|
+
toString: {} | null;
|
|
139
|
+
apply?: {} | null | undefined;
|
|
140
|
+
call?: {} | null | undefined;
|
|
141
|
+
bind?: {} | null | undefined;
|
|
142
|
+
} | null;
|
|
143
|
+
toString: {} | null;
|
|
144
|
+
toLocaleString: {} | null;
|
|
145
|
+
valueOf: {} | null;
|
|
146
|
+
hasOwnProperty: {} | null;
|
|
147
|
+
isPrototypeOf: {} | null;
|
|
148
|
+
propertyIsEnumerable: {} | null;
|
|
149
|
+
} | null | undefined;
|
|
150
|
+
getPrototypeOf?: {} | null | undefined;
|
|
151
|
+
getOwnPropertyDescriptor?: {} | null | undefined;
|
|
152
|
+
getOwnPropertyNames?: {} | null | undefined;
|
|
153
|
+
create?: {} | null | undefined;
|
|
154
|
+
defineProperty?: {} | null | undefined;
|
|
155
|
+
defineProperties?: {} | null | undefined;
|
|
156
|
+
seal?: {} | null | undefined;
|
|
157
|
+
freeze?: {} | null | undefined;
|
|
158
|
+
preventExtensions?: {} | null | undefined;
|
|
159
|
+
isSealed?: {} | null | undefined;
|
|
160
|
+
isFrozen?: {} | null | undefined;
|
|
161
|
+
isExtensible?: {} | null | undefined;
|
|
162
|
+
keys?: {} | null | undefined;
|
|
163
|
+
assign?: {} | null | undefined;
|
|
164
|
+
getOwnPropertySymbols?: {} | null | undefined;
|
|
165
|
+
is?: {} | null | undefined;
|
|
166
|
+
setPrototypeOf?: {} | null | undefined;
|
|
167
|
+
values?: {} | null | undefined;
|
|
168
|
+
entries?: {} | null | undefined;
|
|
169
|
+
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
170
|
+
fromEntries?: {} | null | undefined;
|
|
171
|
+
hasOwn?: {} | null | undefined;
|
|
172
|
+
}>;
|
|
173
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
174
|
+
id: number;
|
|
175
|
+
content: import("mongoose").Types.DocumentArray<{
|
|
176
|
+
prototype?: {
|
|
177
|
+
constructor: {
|
|
178
|
+
name?: unknown;
|
|
179
|
+
[Symbol.hasInstance]?: {} | null | undefined;
|
|
180
|
+
prototype?: unknown;
|
|
181
|
+
length?: unknown;
|
|
182
|
+
caller?: any | null | undefined;
|
|
183
|
+
arguments?: unknown;
|
|
184
|
+
toString: {} | null;
|
|
185
|
+
apply?: {} | null | undefined;
|
|
186
|
+
call?: {} | null | undefined;
|
|
187
|
+
bind?: {} | null | undefined;
|
|
188
|
+
} | null;
|
|
189
|
+
toString: {} | null;
|
|
190
|
+
toLocaleString: {} | null;
|
|
191
|
+
valueOf: {} | null;
|
|
192
|
+
hasOwnProperty: {} | null;
|
|
193
|
+
isPrototypeOf: {} | null;
|
|
194
|
+
propertyIsEnumerable: {} | null;
|
|
195
|
+
} | null | undefined;
|
|
196
|
+
getPrototypeOf?: {} | null | undefined;
|
|
197
|
+
getOwnPropertyDescriptor?: {} | null | undefined;
|
|
198
|
+
getOwnPropertyNames?: {} | null | undefined;
|
|
199
|
+
create?: {} | null | undefined;
|
|
200
|
+
defineProperty?: {} | null | undefined;
|
|
201
|
+
defineProperties?: {} | null | undefined;
|
|
202
|
+
seal?: {} | null | undefined;
|
|
203
|
+
freeze?: {} | null | undefined;
|
|
204
|
+
preventExtensions?: {} | null | undefined;
|
|
205
|
+
isSealed?: {} | null | undefined;
|
|
206
|
+
isFrozen?: {} | null | undefined;
|
|
207
|
+
isExtensible?: {} | null | undefined;
|
|
208
|
+
keys?: {} | null | undefined;
|
|
209
|
+
assign?: {} | null | undefined;
|
|
210
|
+
getOwnPropertySymbols?: {} | null | undefined;
|
|
211
|
+
is?: {} | null | undefined;
|
|
212
|
+
setPrototypeOf?: {} | null | undefined;
|
|
213
|
+
values?: {} | null | undefined;
|
|
214
|
+
entries?: {} | null | undefined;
|
|
215
|
+
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
216
|
+
fromEntries?: {} | null | undefined;
|
|
217
|
+
hasOwn?: {} | null | undefined;
|
|
218
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
219
|
+
prototype?: {
|
|
220
|
+
constructor: {
|
|
221
|
+
name?: unknown;
|
|
222
|
+
[Symbol.hasInstance]?: {} | null | undefined;
|
|
223
|
+
prototype?: unknown;
|
|
224
|
+
length?: unknown;
|
|
225
|
+
caller?: any | null | undefined;
|
|
226
|
+
arguments?: unknown;
|
|
227
|
+
toString: {} | null;
|
|
228
|
+
apply?: {} | null | undefined;
|
|
229
|
+
call?: {} | null | undefined;
|
|
230
|
+
bind?: {} | null | undefined;
|
|
231
|
+
} | null;
|
|
232
|
+
toString: {} | null;
|
|
233
|
+
toLocaleString: {} | null;
|
|
234
|
+
valueOf: {} | null;
|
|
235
|
+
hasOwnProperty: {} | null;
|
|
236
|
+
isPrototypeOf: {} | null;
|
|
237
|
+
propertyIsEnumerable: {} | null;
|
|
238
|
+
} | null | undefined;
|
|
239
|
+
getPrototypeOf?: {} | null | undefined;
|
|
240
|
+
getOwnPropertyDescriptor?: {} | null | undefined;
|
|
241
|
+
getOwnPropertyNames?: {} | null | undefined;
|
|
242
|
+
create?: {} | null | undefined;
|
|
243
|
+
defineProperty?: {} | null | undefined;
|
|
244
|
+
defineProperties?: {} | null | undefined;
|
|
245
|
+
seal?: {} | null | undefined;
|
|
246
|
+
freeze?: {} | null | undefined;
|
|
247
|
+
preventExtensions?: {} | null | undefined;
|
|
248
|
+
isSealed?: {} | null | undefined;
|
|
249
|
+
isFrozen?: {} | null | undefined;
|
|
250
|
+
isExtensible?: {} | null | undefined;
|
|
251
|
+
keys?: {} | null | undefined;
|
|
252
|
+
assign?: {} | null | undefined;
|
|
253
|
+
getOwnPropertySymbols?: {} | null | undefined;
|
|
254
|
+
is?: {} | null | undefined;
|
|
255
|
+
setPrototypeOf?: {} | null | undefined;
|
|
256
|
+
values?: {} | null | undefined;
|
|
257
|
+
entries?: {} | null | undefined;
|
|
258
|
+
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
259
|
+
fromEntries?: {} | null | undefined;
|
|
260
|
+
hasOwn?: {} | null | undefined;
|
|
261
|
+
}> & {
|
|
262
|
+
prototype?: {
|
|
263
|
+
constructor: {
|
|
264
|
+
name?: unknown;
|
|
265
|
+
[Symbol.hasInstance]?: {} | null | undefined;
|
|
266
|
+
prototype?: unknown;
|
|
267
|
+
length?: unknown;
|
|
268
|
+
caller?: any | null | undefined;
|
|
269
|
+
arguments?: unknown;
|
|
270
|
+
toString: {} | null;
|
|
271
|
+
apply?: {} | null | undefined;
|
|
272
|
+
call?: {} | null | undefined;
|
|
273
|
+
bind?: {} | null | undefined;
|
|
274
|
+
} | null;
|
|
275
|
+
toString: {} | null;
|
|
276
|
+
toLocaleString: {} | null;
|
|
277
|
+
valueOf: {} | null;
|
|
278
|
+
hasOwnProperty: {} | null;
|
|
279
|
+
isPrototypeOf: {} | null;
|
|
280
|
+
propertyIsEnumerable: {} | null;
|
|
281
|
+
} | null | undefined;
|
|
282
|
+
getPrototypeOf?: {} | null | undefined;
|
|
283
|
+
getOwnPropertyDescriptor?: {} | null | undefined;
|
|
284
|
+
getOwnPropertyNames?: {} | null | undefined;
|
|
285
|
+
create?: {} | null | undefined;
|
|
286
|
+
defineProperty?: {} | null | undefined;
|
|
287
|
+
defineProperties?: {} | null | undefined;
|
|
288
|
+
seal?: {} | null | undefined;
|
|
289
|
+
freeze?: {} | null | undefined;
|
|
290
|
+
preventExtensions?: {} | null | undefined;
|
|
291
|
+
isSealed?: {} | null | undefined;
|
|
292
|
+
isFrozen?: {} | null | undefined;
|
|
293
|
+
isExtensible?: {} | null | undefined;
|
|
294
|
+
keys?: {} | null | undefined;
|
|
295
|
+
assign?: {} | null | undefined;
|
|
296
|
+
getOwnPropertySymbols?: {} | null | undefined;
|
|
297
|
+
is?: {} | null | undefined;
|
|
298
|
+
setPrototypeOf?: {} | null | undefined;
|
|
299
|
+
values?: {} | null | undefined;
|
|
300
|
+
entries?: {} | null | undefined;
|
|
301
|
+
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
302
|
+
fromEntries?: {} | null | undefined;
|
|
303
|
+
hasOwn?: {} | null | undefined;
|
|
304
|
+
}>;
|
|
305
|
+
}>> & import("mongoose").FlatRecord<{
|
|
306
|
+
id: number;
|
|
307
|
+
content: import("mongoose").Types.DocumentArray<{
|
|
308
|
+
prototype?: {
|
|
309
|
+
constructor: {
|
|
310
|
+
name?: unknown;
|
|
311
|
+
[Symbol.hasInstance]?: {} | null | undefined;
|
|
312
|
+
prototype?: unknown;
|
|
313
|
+
length?: unknown;
|
|
314
|
+
caller?: any | null | undefined;
|
|
315
|
+
arguments?: unknown;
|
|
316
|
+
toString: {} | null;
|
|
317
|
+
apply?: {} | null | undefined;
|
|
318
|
+
call?: {} | null | undefined;
|
|
319
|
+
bind?: {} | null | undefined;
|
|
320
|
+
} | null;
|
|
321
|
+
toString: {} | null;
|
|
322
|
+
toLocaleString: {} | null;
|
|
323
|
+
valueOf: {} | null;
|
|
324
|
+
hasOwnProperty: {} | null;
|
|
325
|
+
isPrototypeOf: {} | null;
|
|
326
|
+
propertyIsEnumerable: {} | null;
|
|
327
|
+
} | null | undefined;
|
|
328
|
+
getPrototypeOf?: {} | null | undefined;
|
|
329
|
+
getOwnPropertyDescriptor?: {} | null | undefined;
|
|
330
|
+
getOwnPropertyNames?: {} | null | undefined;
|
|
331
|
+
create?: {} | null | undefined;
|
|
332
|
+
defineProperty?: {} | null | undefined;
|
|
333
|
+
defineProperties?: {} | null | undefined;
|
|
334
|
+
seal?: {} | null | undefined;
|
|
335
|
+
freeze?: {} | null | undefined;
|
|
336
|
+
preventExtensions?: {} | null | undefined;
|
|
337
|
+
isSealed?: {} | null | undefined;
|
|
338
|
+
isFrozen?: {} | null | undefined;
|
|
339
|
+
isExtensible?: {} | null | undefined;
|
|
340
|
+
keys?: {} | null | undefined;
|
|
341
|
+
assign?: {} | null | undefined;
|
|
342
|
+
getOwnPropertySymbols?: {} | null | undefined;
|
|
343
|
+
is?: {} | null | undefined;
|
|
344
|
+
setPrototypeOf?: {} | null | undefined;
|
|
345
|
+
values?: {} | null | undefined;
|
|
346
|
+
entries?: {} | null | undefined;
|
|
347
|
+
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
348
|
+
fromEntries?: {} | null | undefined;
|
|
349
|
+
hasOwn?: {} | null | undefined;
|
|
350
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
351
|
+
prototype?: {
|
|
352
|
+
constructor: {
|
|
353
|
+
name?: unknown;
|
|
354
|
+
[Symbol.hasInstance]?: {} | null | undefined;
|
|
355
|
+
prototype?: unknown;
|
|
356
|
+
length?: unknown;
|
|
357
|
+
caller?: any | null | undefined;
|
|
358
|
+
arguments?: unknown;
|
|
359
|
+
toString: {} | null;
|
|
360
|
+
apply?: {} | null | undefined;
|
|
361
|
+
call?: {} | null | undefined;
|
|
362
|
+
bind?: {} | null | undefined;
|
|
363
|
+
} | null;
|
|
364
|
+
toString: {} | null;
|
|
365
|
+
toLocaleString: {} | null;
|
|
366
|
+
valueOf: {} | null;
|
|
367
|
+
hasOwnProperty: {} | null;
|
|
368
|
+
isPrototypeOf: {} | null;
|
|
369
|
+
propertyIsEnumerable: {} | null;
|
|
370
|
+
} | null | undefined;
|
|
371
|
+
getPrototypeOf?: {} | null | undefined;
|
|
372
|
+
getOwnPropertyDescriptor?: {} | null | undefined;
|
|
373
|
+
getOwnPropertyNames?: {} | null | undefined;
|
|
374
|
+
create?: {} | null | undefined;
|
|
375
|
+
defineProperty?: {} | null | undefined;
|
|
376
|
+
defineProperties?: {} | null | undefined;
|
|
377
|
+
seal?: {} | null | undefined;
|
|
378
|
+
freeze?: {} | null | undefined;
|
|
379
|
+
preventExtensions?: {} | null | undefined;
|
|
380
|
+
isSealed?: {} | null | undefined;
|
|
381
|
+
isFrozen?: {} | null | undefined;
|
|
382
|
+
isExtensible?: {} | null | undefined;
|
|
383
|
+
keys?: {} | null | undefined;
|
|
384
|
+
assign?: {} | null | undefined;
|
|
385
|
+
getOwnPropertySymbols?: {} | null | undefined;
|
|
386
|
+
is?: {} | null | undefined;
|
|
387
|
+
setPrototypeOf?: {} | null | undefined;
|
|
388
|
+
values?: {} | null | undefined;
|
|
389
|
+
entries?: {} | null | undefined;
|
|
390
|
+
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
391
|
+
fromEntries?: {} | null | undefined;
|
|
392
|
+
hasOwn?: {} | null | undefined;
|
|
393
|
+
}> & {
|
|
394
|
+
prototype?: {
|
|
395
|
+
constructor: {
|
|
396
|
+
name?: unknown;
|
|
397
|
+
[Symbol.hasInstance]?: {} | null | undefined;
|
|
398
|
+
prototype?: unknown;
|
|
399
|
+
length?: unknown;
|
|
400
|
+
caller?: any | null | undefined;
|
|
401
|
+
arguments?: unknown;
|
|
402
|
+
toString: {} | null;
|
|
403
|
+
apply?: {} | null | undefined;
|
|
404
|
+
call?: {} | null | undefined;
|
|
405
|
+
bind?: {} | null | undefined;
|
|
406
|
+
} | null;
|
|
407
|
+
toString: {} | null;
|
|
408
|
+
toLocaleString: {} | null;
|
|
409
|
+
valueOf: {} | null;
|
|
410
|
+
hasOwnProperty: {} | null;
|
|
411
|
+
isPrototypeOf: {} | null;
|
|
412
|
+
propertyIsEnumerable: {} | null;
|
|
413
|
+
} | null | undefined;
|
|
414
|
+
getPrototypeOf?: {} | null | undefined;
|
|
415
|
+
getOwnPropertyDescriptor?: {} | null | undefined;
|
|
416
|
+
getOwnPropertyNames?: {} | null | undefined;
|
|
417
|
+
create?: {} | null | undefined;
|
|
418
|
+
defineProperty?: {} | null | undefined;
|
|
419
|
+
defineProperties?: {} | null | undefined;
|
|
420
|
+
seal?: {} | null | undefined;
|
|
421
|
+
freeze?: {} | null | undefined;
|
|
422
|
+
preventExtensions?: {} | null | undefined;
|
|
423
|
+
isSealed?: {} | null | undefined;
|
|
424
|
+
isFrozen?: {} | null | undefined;
|
|
425
|
+
isExtensible?: {} | null | undefined;
|
|
426
|
+
keys?: {} | null | undefined;
|
|
427
|
+
assign?: {} | null | undefined;
|
|
428
|
+
getOwnPropertySymbols?: {} | null | undefined;
|
|
429
|
+
is?: {} | null | undefined;
|
|
430
|
+
setPrototypeOf?: {} | null | undefined;
|
|
431
|
+
values?: {} | null | undefined;
|
|
432
|
+
entries?: {} | null | undefined;
|
|
433
|
+
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
434
|
+
fromEntries?: {} | null | undefined;
|
|
435
|
+
hasOwn?: {} | null | undefined;
|
|
436
|
+
}>;
|
|
437
|
+
}> & {
|
|
438
|
+
_id: import("mongoose").Types.ObjectId;
|
|
439
|
+
} & {
|
|
440
|
+
__v: number;
|
|
43
441
|
}>;
|
package/lib/offers/offer.d.ts
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
25
26
|
import { Document, Model, Schema } from "mongoose";
|
|
26
27
|
export interface IOffer extends Document {
|
|
27
28
|
id: number;
|
|
@@ -61,31 +62,91 @@ export interface IPartnerSection {
|
|
|
61
62
|
name: string;
|
|
62
63
|
offers: IOffer[];
|
|
63
64
|
}
|
|
64
|
-
export declare const PartnerSchema: Schema<any, Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
65
|
-
partnerId?: number | undefined;
|
|
66
|
-
shortName?: string | undefined;
|
|
67
|
-
name?: string | undefined;
|
|
65
|
+
export declare const PartnerSchema: Schema<any, Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
66
|
+
partnerId?: number | null | undefined;
|
|
67
|
+
shortName?: string | null | undefined;
|
|
68
|
+
name?: string | null | undefined;
|
|
69
|
+
}, Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
70
|
+
partnerId?: number | null | undefined;
|
|
71
|
+
shortName?: string | null | undefined;
|
|
72
|
+
name?: string | null | undefined;
|
|
73
|
+
}>> & import("mongoose").FlatRecord<{
|
|
74
|
+
partnerId?: number | null | undefined;
|
|
75
|
+
shortName?: string | null | undefined;
|
|
76
|
+
name?: string | null | undefined;
|
|
77
|
+
}> & {
|
|
78
|
+
_id: import("mongoose").Types.ObjectId;
|
|
79
|
+
} & {
|
|
80
|
+
__v: number;
|
|
68
81
|
}>;
|
|
69
|
-
export declare const OfferSchema: Schema<any, Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
82
|
+
export declare const OfferSchema: Schema<any, Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
70
83
|
type: string;
|
|
71
|
-
id?: number | undefined;
|
|
72
|
-
partnerId?: number | undefined;
|
|
73
|
-
name?: string | undefined;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
id?: number | null | undefined;
|
|
85
|
+
partnerId?: number | null | undefined;
|
|
86
|
+
name?: string | null | undefined;
|
|
87
|
+
hidden?: boolean | null | undefined;
|
|
88
|
+
graphicFolder?: string | null | undefined;
|
|
89
|
+
geo?: string | null | undefined;
|
|
90
|
+
caption?: string | null | undefined;
|
|
91
|
+
link?: string | null | undefined;
|
|
92
|
+
keitaroId?: string | null | undefined;
|
|
80
93
|
graphic?: {
|
|
81
|
-
logo?: string | undefined;
|
|
82
|
-
bg?: string | undefined;
|
|
83
|
-
} | undefined;
|
|
94
|
+
logo?: string | null | undefined;
|
|
95
|
+
bg?: string | null | undefined;
|
|
96
|
+
} | null | undefined;
|
|
84
97
|
history?: {
|
|
85
98
|
name: string[];
|
|
86
99
|
caption: string[];
|
|
87
100
|
link: string[];
|
|
88
101
|
logoNames: string[];
|
|
89
102
|
bgNames: string[];
|
|
90
|
-
} | undefined;
|
|
103
|
+
} | null | undefined;
|
|
104
|
+
}, Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
105
|
+
type: string;
|
|
106
|
+
id?: number | null | undefined;
|
|
107
|
+
partnerId?: number | null | undefined;
|
|
108
|
+
name?: string | null | undefined;
|
|
109
|
+
hidden?: boolean | null | undefined;
|
|
110
|
+
graphicFolder?: string | null | undefined;
|
|
111
|
+
geo?: string | null | undefined;
|
|
112
|
+
caption?: string | null | undefined;
|
|
113
|
+
link?: string | null | undefined;
|
|
114
|
+
keitaroId?: string | null | undefined;
|
|
115
|
+
graphic?: {
|
|
116
|
+
logo?: string | null | undefined;
|
|
117
|
+
bg?: string | null | undefined;
|
|
118
|
+
} | null | undefined;
|
|
119
|
+
history?: {
|
|
120
|
+
name: string[];
|
|
121
|
+
caption: string[];
|
|
122
|
+
link: string[];
|
|
123
|
+
logoNames: string[];
|
|
124
|
+
bgNames: string[];
|
|
125
|
+
} | null | undefined;
|
|
126
|
+
}>> & import("mongoose").FlatRecord<{
|
|
127
|
+
type: string;
|
|
128
|
+
id?: number | null | undefined;
|
|
129
|
+
partnerId?: number | null | undefined;
|
|
130
|
+
name?: string | null | undefined;
|
|
131
|
+
hidden?: boolean | null | undefined;
|
|
132
|
+
graphicFolder?: string | null | undefined;
|
|
133
|
+
geo?: string | null | undefined;
|
|
134
|
+
caption?: string | null | undefined;
|
|
135
|
+
link?: string | null | undefined;
|
|
136
|
+
keitaroId?: string | null | undefined;
|
|
137
|
+
graphic?: {
|
|
138
|
+
logo?: string | null | undefined;
|
|
139
|
+
bg?: string | null | undefined;
|
|
140
|
+
} | null | undefined;
|
|
141
|
+
history?: {
|
|
142
|
+
name: string[];
|
|
143
|
+
caption: string[];
|
|
144
|
+
link: string[];
|
|
145
|
+
logoNames: string[];
|
|
146
|
+
bgNames: string[];
|
|
147
|
+
} | null | undefined;
|
|
148
|
+
}> & {
|
|
149
|
+
_id: import("mongoose").Types.ObjectId;
|
|
150
|
+
} & {
|
|
151
|
+
__v: number;
|
|
91
152
|
}>;
|
package/lib/offers/section.d.ts
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
25
26
|
import { Schema } from "mongoose";
|
|
26
27
|
export interface IOffersSection {
|
|
27
28
|
id: number;
|
|
@@ -34,10 +35,22 @@ export interface IOffersSection {
|
|
|
34
35
|
[key: string]: string;
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
|
-
export declare const OffersSectionSchema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
38
|
+
export declare const OffersSectionSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
38
39
|
id: number;
|
|
39
40
|
title?: any;
|
|
40
41
|
button?: any;
|
|
42
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
43
|
+
id: number;
|
|
44
|
+
title?: any;
|
|
45
|
+
button?: any;
|
|
46
|
+
}>> & import("mongoose").FlatRecord<{
|
|
47
|
+
id: number;
|
|
48
|
+
title?: any;
|
|
49
|
+
button?: any;
|
|
50
|
+
}> & {
|
|
51
|
+
_id: import("mongoose").Types.ObjectId;
|
|
52
|
+
} & {
|
|
53
|
+
__v: number;
|
|
41
54
|
}>;
|
|
42
55
|
export declare enum DefaultSectionId {
|
|
43
56
|
GAMBLING_MAIN = 0,
|
package/lib/panel/user.d.ts
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
25
26
|
import { Document, Schema } from "mongoose";
|
|
26
27
|
export declare enum PanelUserAccessScope {
|
|
27
28
|
ADMIN = 0,
|
|
@@ -39,8 +40,20 @@ export interface IPanelUser extends Document {
|
|
|
39
40
|
passwordHash: string;
|
|
40
41
|
accessScopes: PanelUserAccessScope[];
|
|
41
42
|
}
|
|
42
|
-
export declare const PanelUserSchema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
43
|
+
export declare const PanelUserSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
43
44
|
accessScopes: string[];
|
|
44
|
-
passwordHash?: string | undefined;
|
|
45
|
-
username?: string | undefined;
|
|
45
|
+
passwordHash?: string | null | undefined;
|
|
46
|
+
username?: string | null | undefined;
|
|
47
|
+
}, Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
48
|
+
accessScopes: string[];
|
|
49
|
+
passwordHash?: string | null | undefined;
|
|
50
|
+
username?: string | null | undefined;
|
|
51
|
+
}>> & import("mongoose").FlatRecord<{
|
|
52
|
+
accessScopes: string[];
|
|
53
|
+
passwordHash?: string | null | undefined;
|
|
54
|
+
username?: string | null | undefined;
|
|
55
|
+
}> & {
|
|
56
|
+
_id: import("mongoose").Types.ObjectId;
|
|
57
|
+
} & {
|
|
58
|
+
__v: number;
|
|
46
59
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bprotsyk/aso-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.55",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/unzipper": "^0.10.10",
|
|
31
31
|
"axios": "^1.4.0",
|
|
32
32
|
"module-alias": "^2.2.2",
|
|
33
|
-
"mongoose": "^
|
|
33
|
+
"mongoose": "^8.10.0",
|
|
34
34
|
"mustache": "^4.2.0",
|
|
35
35
|
"react": "^18.3.1",
|
|
36
36
|
"react-dom": "^18.3.1",
|
package/src/app/app.ts
CHANGED
|
@@ -59,6 +59,30 @@ export enum EPlatform {
|
|
|
59
59
|
AMAZON = 'am'
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
|
|
63
|
+
export const getPlatformName = (platform: EPlatform | undefined): string | false => {
|
|
64
|
+
switch (platform) {
|
|
65
|
+
case EPlatform.SAMSUNG:
|
|
66
|
+
return "samsung";
|
|
67
|
+
case EPlatform.HUAWEI:
|
|
68
|
+
return "huawei";
|
|
69
|
+
case EPlatform.ruSTORE:
|
|
70
|
+
return "ruStore";
|
|
71
|
+
case EPlatform.XIAOMI:
|
|
72
|
+
return "xiaomi";
|
|
73
|
+
case EPlatform.APKPURE:
|
|
74
|
+
return "apkpure";
|
|
75
|
+
case EPlatform.TELEGRAM:
|
|
76
|
+
return "telegram";
|
|
77
|
+
case EPlatform.AMAZON:
|
|
78
|
+
return "amazon";
|
|
79
|
+
case EPlatform.GENERAL:
|
|
80
|
+
return false;
|
|
81
|
+
default:
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
62
86
|
export interface IPlatformParams {
|
|
63
87
|
enabled: boolean,
|
|
64
88
|
geo: string[],
|
|
@@ -3,7 +3,7 @@ import { IOffer } from "../../offers/offer"
|
|
|
3
3
|
import keitaroApi from "./http"
|
|
4
4
|
import { IKeitaroCampaign } from "../../keitaro/keitaro-campaign";
|
|
5
5
|
import { IKeitaroDomain } from "../../keitaro/keitaro-domain";
|
|
6
|
-
import { IApp } from "../../app/app";
|
|
6
|
+
import { EPlatform, getPlatformName, IApp } from "../../app/app";
|
|
7
7
|
import { TRAFFIC_SOURCE_ID_FLASH_AI, prepareOWCampaignParameters } from "../../utils/keitaro-utils";
|
|
8
8
|
import { convertMillisToDate, getTimestampsForTodayAndYesterday } from "../../utils/general";
|
|
9
9
|
import { IKeitaroOffer } from "index";
|
|
@@ -237,8 +237,10 @@ export async function upsertStreamToCampaign(campaign: IKeitaroCampaign, stream:
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
async function cloneOWCampaign(app: IApp): Promise<IKeitaroCampaign | any> {
|
|
240
|
+
async function cloneOWCampaign(app: IApp, platform?: EPlatform): Promise<IKeitaroCampaign | any> {
|
|
241
241
|
let name = `#${app.id} [◈]`
|
|
242
|
+
let platformName = platform ? getPlatformName(platform) : null;
|
|
243
|
+
const platformCampaignName = `#${app.id} [◈] (${platformName})`
|
|
242
244
|
const generateAlias = () => {
|
|
243
245
|
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
|
244
246
|
return Array.from(
|
|
@@ -248,7 +250,21 @@ async function cloneOWCampaign(app: IApp): Promise<IKeitaroCampaign | any> {
|
|
|
248
250
|
};
|
|
249
251
|
|
|
250
252
|
let allCampaigns = await getAllCampaigns()
|
|
251
|
-
|
|
253
|
+
|
|
254
|
+
let matchingCampaign: IKeitaroCampaign[] = [];
|
|
255
|
+
|
|
256
|
+
if (platform) {
|
|
257
|
+
matchingCampaign = allCampaigns.filter((c) =>
|
|
258
|
+
c.name === `#${app.id} [◈] (${platformName})`
|
|
259
|
+
)
|
|
260
|
+
} else {
|
|
261
|
+
matchingCampaign = allCampaigns.filter((c) =>
|
|
262
|
+
c.name === `#${app.id} [◈]`
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
252
268
|
if (matchingCampaign.length > 0) return matchingCampaign[0]
|
|
253
269
|
|
|
254
270
|
const originalCampaign : IKeitaroCampaign = await getCampaignById(2673)
|
|
@@ -276,7 +292,7 @@ async function cloneOWCampaign(app: IApp): Promise<IKeitaroCampaign | any> {
|
|
|
276
292
|
|
|
277
293
|
let payload: Partial<IKeitaroCampaign> = {
|
|
278
294
|
// Унікальні поля
|
|
279
|
-
name: name,
|
|
295
|
+
name: platformName ? platformCampaignName : name,
|
|
280
296
|
alias: alias,
|
|
281
297
|
domain_id: domain.id,
|
|
282
298
|
position: [maxPosition + 100],
|
package/test-keitaro.js
CHANGED
|
@@ -2,7 +2,7 @@ const { KeitaroService } = require('./lib/network/keitaro/keitaro-service');
|
|
|
2
2
|
|
|
3
3
|
async function testClone() {
|
|
4
4
|
try {
|
|
5
|
-
const result = await KeitaroService.cloneOWCampaign({ id:
|
|
5
|
+
const result = await KeitaroService.cloneOWCampaign({ id: 999 }, 'sm' );
|
|
6
6
|
console.log('Cloned campaign:', result);
|
|
7
7
|
} catch (error) {
|
|
8
8
|
console.error('Error:', error);
|