@bprotsyk/aso-core 1.2.219 → 1.2.224

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.
Files changed (75) hide show
  1. package/lib/app/app-integration.d.ts +53 -0
  2. package/lib/app/app-integration.js +63 -0
  3. package/lib/app/app-list-item.d.ts +5 -0
  4. package/lib/app/app-list-item.js +2 -0
  5. package/lib/app/app-type.d.ts +4 -0
  6. package/lib/app/app-type.js +8 -0
  7. package/lib/app/app.d.ts +177 -0
  8. package/lib/app/app.js +216 -0
  9. package/lib/flash/flash-app.d.ts +1 -1
  10. package/lib/general/cloudflare-domain.d.ts +42 -0
  11. package/lib/general/cloudflare-domain.js +12 -0
  12. package/lib/general/colored-text.d.ts +7 -0
  13. package/lib/general/colored-text.js +28 -0
  14. package/lib/general/domain.d.ts +92 -0
  15. package/lib/general/domain.js +38 -0
  16. package/lib/general/namecheap-domain.d.ts +80 -0
  17. package/lib/general/namecheap-domain.js +14 -0
  18. package/lib/general/push.d.ts +6 -0
  19. package/lib/general/push.js +2 -0
  20. package/lib/general/queue.d.ts +1 -0
  21. package/lib/general/queue.js +2 -0
  22. package/lib/general/shape.d.ts +18 -0
  23. package/lib/general/shape.js +36 -0
  24. package/lib/index.d.ts +13 -32
  25. package/lib/index.js +28 -29
  26. package/lib/network/keitaro/keitaro-service.d.ts +4 -4
  27. package/lib/offers/list.d.ts +37 -0
  28. package/lib/offers/list.js +12 -0
  29. package/lib/offers/offer.d.ts +95 -0
  30. package/lib/offers/offer.js +38 -0
  31. package/lib/offers/section.d.ts +47 -0
  32. package/lib/offers/section.js +20 -0
  33. package/lib/panel/flash/upsert-flash-app-request.d.ts +1 -1
  34. package/lib/utils/keitaro-utils.d.ts +7 -7
  35. package/package.json +1 -1
  36. package/src/{flash/flash-app-integration.ts → app/app-integration.ts} +1 -1
  37. package/src/{flash/flash-app-list-item.ts → app/app-list-item.ts} +1 -1
  38. package/src/{flash/flash-app-type.ts → app/app-type.ts} +1 -1
  39. package/src/{flash/flash-app.ts → app/app.ts} +20 -10
  40. package/src/{models → general}/domain.ts +1 -1
  41. package/src/index.ts +13 -34
  42. package/src/network/keitaro/keitaro-service.ts +4 -4
  43. package/src/offers/list.ts +20 -0
  44. package/src/offers/offer.ts +77 -0
  45. package/src/offers/section.ts +30 -0
  46. package/src/panel/flash/upsert-flash-app-request.ts +1 -1
  47. package/src/utils/keitaro-utils.ts +10 -10
  48. package/src/aso/config/aso-config-v0.ts +0 -441
  49. package/src/aso/config/aso-config-v1.ts +0 -440
  50. package/src/aso/config/aso-config-v2.ts +0 -399
  51. package/src/aso/config/aso-config-v3.ts +0 -396
  52. package/src/aso/config/aso-config-v4.ts +0 -305
  53. package/src/aso/config/aso-config-v5.ts +0 -328
  54. package/src/aso/config/aso-default-config.ts +0 -67
  55. package/src/aso/config/aso-single-response.ts +0 -6
  56. package/src/aso/offer/aso-customized-offer.ts +0 -12
  57. package/src/aso/offer/aso-offer-response.ts +0 -7
  58. package/src/aso/offer/aso-offer-section.ts +0 -7
  59. package/src/aso/offer/aso-single-offer.ts +0 -5
  60. package/src/aso/offerwall/auth/offerwall-auth-config.ts +0 -17
  61. package/src/aso/offerwall/auth/offerwall-auth-localization.ts +0 -9
  62. package/src/aso/offerwall/auth/offerwall-auth-submit-request.ts +0 -3
  63. package/src/aso/offerwall/auth/offerwall-auth-submit-response.ts +0 -3
  64. package/src/aso/offerwall/offerwall-home-dialog-data.ts +0 -6
  65. package/src/aso/offerwall/offerwall-offer.ts +0 -9
  66. package/src/aso/offerwall/offerwall-response.ts +0 -7
  67. package/src/aso/offerwall/offerwall-section.ts +0 -7
  68. package/src/aso/usage-logs/aso-config-fetch-entry.ts +0 -31
  69. package/src/shared/offer.ts +0 -12
  70. /package/src/{models → general}/cloudflare-domain.ts +0 -0
  71. /package/src/{shared → general}/colored-text.tsx +0 -0
  72. /package/src/{models → general}/namecheap-domain.ts +0 -0
  73. /package/src/{shared → general}/push.ts +0 -0
  74. /package/src/{shared → general}/queue.ts +0 -0
  75. /package/src/{shared → general}/shape.tsx +0 -0
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OfferSchema = exports.PartnerSchema = exports.IOfferType = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ var IOfferType;
6
+ (function (IOfferType) {
7
+ IOfferType["GAMBLING"] = "gambling";
8
+ IOfferType["BETTING"] = "betting";
9
+ IOfferType["FIN"] = "fin";
10
+ })(IOfferType = exports.IOfferType || (exports.IOfferType = {}));
11
+ exports.PartnerSchema = new mongoose_1.Schema({
12
+ partnerId: Number,
13
+ shortName: String,
14
+ name: String
15
+ });
16
+ exports.OfferSchema = new mongoose_1.Schema({
17
+ id: { type: Number, unique: true },
18
+ name: String,
19
+ graphicFolder: String,
20
+ graphic: {
21
+ logo: String,
22
+ bg: String
23
+ },
24
+ geo: String,
25
+ caption: String,
26
+ link: String,
27
+ partnerId: Number,
28
+ type: { type: IOfferType },
29
+ keitaroId: String,
30
+ hidden: Boolean,
31
+ history: {
32
+ link: [String],
33
+ logoNames: [String],
34
+ bgNames: [String],
35
+ name: [String],
36
+ caption: [String]
37
+ }
38
+ });
@@ -0,0 +1,47 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import { Schema } from "mongoose";
26
+ export interface IOffersSection {
27
+ id: number;
28
+ title: {
29
+ none: string;
30
+ [key: string]: string;
31
+ };
32
+ button: {
33
+ none: string;
34
+ [key: string]: string;
35
+ };
36
+ }
37
+ export declare const OffersSectionSchema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
38
+ id: number;
39
+ button?: any;
40
+ title?: any;
41
+ }>;
42
+ export declare enum DefaultSectionId {
43
+ GAMBLING_MAIN = 0,
44
+ BETTING_MAIN = 1,
45
+ GAMBLING_PLAYED = 2,
46
+ BETTING_PLAYED = 3
47
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultSectionId = exports.OffersSectionSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ exports.OffersSectionSchema = new mongoose_1.Schema({
6
+ id: {
7
+ type: Number,
8
+ unique: true,
9
+ required: true
10
+ },
11
+ title: Object,
12
+ button: Object
13
+ });
14
+ var DefaultSectionId;
15
+ (function (DefaultSectionId) {
16
+ DefaultSectionId[DefaultSectionId["GAMBLING_MAIN"] = 0] = "GAMBLING_MAIN";
17
+ DefaultSectionId[DefaultSectionId["BETTING_MAIN"] = 1] = "BETTING_MAIN";
18
+ DefaultSectionId[DefaultSectionId["GAMBLING_PLAYED"] = 2] = "GAMBLING_PLAYED";
19
+ DefaultSectionId[DefaultSectionId["BETTING_PLAYED"] = 3] = "BETTING_PLAYED";
20
+ })(DefaultSectionId = exports.DefaultSectionId || (exports.DefaultSectionId = {}));
@@ -1,4 +1,4 @@
1
- import { IAppGenerationOptions, IAppKeitaroData, IBannerParams, IDeveloperParams, IDirectParams, IDomainParams, IOffersStubParams, IPrivacyPolicyParams, IRemoveDataParams, IntegrationVersion } from "flash/flash-app";
1
+ import { IAppGenerationOptions, IAppKeitaroData, IBannerParams, IDeveloperParams, IDirectParams, IDomainParams, IOffersStubParams, IPrivacyPolicyParams, IRemoveDataParams, IntegrationVersion } from "app/app";
2
2
  export interface IUpsertFlashAppRequest {
3
3
  id: number;
4
4
  name?: string;
@@ -1,15 +1,15 @@
1
1
  import { IKeitaroStream } from "../keitaro/keitaro-stream";
2
- import { IFlashApp } from "../flash/flash-app";
2
+ import { IApp } from "../app/app";
3
3
  import { IKeitaroCampaign, IKeitaroCampaignParameters } from "../keitaro/keitaro-campaign";
4
4
  export declare const TRAFFIC_SOURCE_ID_FLASH_AI = 22;
5
5
  export declare let addGeosToAllRedirectCampaigns: (geosToAdd: string) => Promise<void>;
6
6
  export declare let removeGeosFromAllRedirectCampaigns: (geoToRemove: string) => Promise<void>;
7
- export declare let createOrFindFlashRedirectCampaign: (app: IFlashApp) => Promise<IKeitaroCampaign>;
8
- export declare let prepareOWCampaignParameters: (app: IFlashApp) => IKeitaroCampaignParameters;
9
- export declare function createOWStreamPartialPayload(app: IFlashApp): Partial<IKeitaroStream>;
10
- export declare function createFlashCampaigns(app: IFlashApp): Promise<{
7
+ export declare let createOrFindFlashRedirectCampaign: (app: IApp) => Promise<IKeitaroCampaign>;
8
+ export declare let prepareOWCampaignParameters: (app: IApp) => IKeitaroCampaignParameters;
9
+ export declare function createOWStreamPartialPayload(app: IApp): Partial<IKeitaroStream>;
10
+ export declare function createFlashCampaigns(app: IApp): Promise<{
11
11
  tracking: IKeitaroCampaign;
12
12
  redirect: IKeitaroCampaign;
13
13
  }>;
14
- export declare function createDirectCampaign(app: IFlashApp): Promise<IKeitaroCampaign>;
15
- export declare function createOWCampaign(app: IFlashApp): Promise<IKeitaroCampaign>;
14
+ export declare function createDirectCampaign(app: IApp): Promise<IKeitaroCampaign>;
15
+ export declare function createOWCampaign(app: IApp): Promise<IKeitaroCampaign>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "1.2.219",
3
+ "version": "1.2.224",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -59,7 +59,7 @@ export enum AlternativeOnActivityResult {
59
59
  CALLBACK = "Callback"
60
60
  }
61
61
 
62
- export interface IFlashIntegration {
62
+ export interface IAppIntegration {
63
63
  id: number,
64
64
  name: string,
65
65
  description: string,
@@ -1,4 +1,4 @@
1
- export interface IFlashAppListItem {
1
+ export interface IAppListItem {
2
2
  id: number,
3
3
  bundle: string,
4
4
  name: string
@@ -1,4 +1,4 @@
1
- export enum FlashAppType {
1
+ export enum AppType {
2
2
  GAMBLING = "gambling",
3
3
  FINANCES = "finances" // do not change the order!
4
4
  }
@@ -1,10 +1,10 @@
1
1
  import { AlternativeLayoutType, AlternativeLogicType, AlternativeNavigation, AlternativeNetworkTool, AlternativeOnActivityResult, AlternativeOnBackPressed, AlternativeSourceType, AlternativeStorageType } from "index";
2
- import { FlashAppType } from "./flash-app-type";
2
+ import { AppType } from "./app-type";
3
3
  import mongoose, { Document, Model, model, PipelineStage, Schema, UpdateQuery, UpdateWithAggregationPipeline } from "mongoose";
4
- import { AlternativeFullscreen } from "flash/flash-app-integration";
4
+ import { AlternativeFullscreen } from "app/app-integration";
5
5
  const util = require("util")
6
6
 
7
- export interface IFlashApp extends Document {
7
+ export interface IApp extends Document {
8
8
  id: number
9
9
  enabled: boolean,
10
10
  name: string
@@ -14,7 +14,7 @@ export interface IFlashApp extends Document {
14
14
  pushesEnabled?: boolean
15
15
  sourceUrl?: string,
16
16
  policyUrl?: string
17
- type: FlashAppType,
17
+ type: AppType,
18
18
  geos: string,
19
19
 
20
20
  onesignalAppId: string
@@ -32,8 +32,17 @@ export interface IFlashApp extends Document {
32
32
  offersStubParams?: IOffersStubParams
33
33
  directParams?: IDirectParams,
34
34
  bannerParams?: IBannerParams,
35
+ remoteServerParams?: IRemoteServerParams,
35
36
  domainParams: IDomainParams
36
37
  developerParams: IDeveloperParams
38
+
39
+ offersListId: number
40
+ }
41
+
42
+ export interface IRemoteServerParams {
43
+ ip: string,
44
+ port: string,
45
+ password: string
37
46
  }
38
47
 
39
48
  export interface IOffersStubParams {
@@ -56,7 +65,7 @@ export interface IBannerParams {
56
65
  imagePath: string,
57
66
  imageParam: string,
58
67
  linkParam: string,
59
- showStubOnError: boolean
68
+ showStubOnError?: boolean
60
69
  }
61
70
 
62
71
  export interface IRemoveDataParams {
@@ -144,7 +153,7 @@ export enum PlugType {
144
153
  OTHER = "OTHER"
145
154
  }
146
155
 
147
- export const FlashAppSchema = new Schema({
156
+ export const AppSchema = new Schema({
148
157
  id: {
149
158
  type: Number,
150
159
  unique: true,
@@ -176,8 +185,8 @@ export const FlashAppSchema = new Schema({
176
185
  },
177
186
  type: {
178
187
  type: String,
179
- enum: FlashAppType,
180
- default: FlashAppType.GAMBLING
188
+ enum: AppType,
189
+ default: AppType.GAMBLING
181
190
  },
182
191
  geos: {
183
192
  type: String,
@@ -285,6 +294,7 @@ export const FlashAppSchema = new Schema({
285
294
  offersStubParams: Object,
286
295
  bannerParams: Object,
287
296
  directParams: Object,
297
+ remoteServerParams: Object,
288
298
  domainParams: {
289
299
  name: {
290
300
  type: String,
@@ -298,7 +308,7 @@ export const FlashAppSchema = new Schema({
298
308
  })
299
309
 
300
310
  // TODO app type (casino / fin)
301
- export async function updateSchemaAndMoveValue(model: Model<IFlashApp>): Promise<void> {
311
+ export async function updateSchemaAndMoveValue(model: Model<IApp>): Promise<void> {
302
312
  await model.syncIndexes()
303
313
  let pipelineStage: PipelineStage[] = [
304
314
  {
@@ -322,7 +332,7 @@ export async function updateSchemaAndMoveValue(model: Model<IFlashApp>): Promise
322
332
  // await model.schema.dropIndex("generationOptions.keyPassword_1")
323
333
  await aggregation.exec()
324
334
 
325
- const updateOperation: UpdateQuery<IFlashApp> = {
335
+ const updateOperation: UpdateQuery<IApp> = {
326
336
  $set: {
327
337
  plugId: "none"
328
338
  },
@@ -1,4 +1,4 @@
1
- import { ICloudflareDomainType } from "models/cloudflare-domain"
1
+ import { ICloudflareDomainType } from "general/cloudflare-domain"
2
2
  import { Document, Model, Schema, model } from "mongoose"
3
3
 
4
4
  export interface IDomain extends Document {
package/src/index.ts CHANGED
@@ -1,41 +1,20 @@
1
- export { IAsoCustomizedOffer } from "./aso/offer/aso-customized-offer"
2
- export { IAsoOfferResponse } from "./aso/offer/aso-offer-response"
3
- export { IAsoSection } from "./aso/offer/aso-offer-section"
4
- export { IAsoDefaultConfig } from "./aso/config/aso-default-config"
5
- export { IAsoConfigResponse } from "./aso/config/aso-single-response"
6
- export { IAsoSingleOffer } from "./aso/offer/aso-single-offer"
7
- export * as ASO_v0 from "./aso/config/aso-config-v0"
8
- export * as ASO_v1 from "./aso/config/aso-config-v1"
9
- export * as ASO_v2 from "./aso/config/aso-config-v2"
10
- export * as ASO_v3 from "./aso/config/aso-config-v3"
11
- export * as ASO_v4 from "./aso/config/aso-config-v4"
12
- export * as ASO_v5 from "./aso/config/aso-config-v5"
13
- export { IPush } from "./shared/push"
1
+ export { IPush } from "./general/push"
14
2
 
15
- export { IOffer } from "./shared/offer"
3
+ export { IOffer, IPartner, IOfferType } from "./offers/offer"
4
+ export { IOffersSection, OffersSectionSchema, DefaultSectionId } from "./offers/section"
5
+ export { IAppOffersSection, ISectionsList, SectionsListSchema } from "./offers/list"
16
6
 
17
- export { IOfferWallSection } from "./aso/offerwall/offerwall-section"
18
- export { IOfferWallOffer } from "./aso/offerwall/offerwall-offer"
19
- export { IOfferWallResponse } from "./aso/offerwall/offerwall-response"
20
- export { IOfferWallHomeDialogData } from "./aso/offerwall/offerwall-home-dialog-data"
21
-
22
- export { IntegrationAlterations, IntegrationVersion, IFlashApp, FlashAppSchema, updateSchemaAndMoveValue, PlugType } from "./flash/flash-app"
23
- export { IFlashAppListItem } from "./flash/flash-app-list-item"
24
- export { FlashAppType } from "./flash/flash-app-type"
25
- export { AlternativeLayoutType, AlternativeSourceType, AlternativeLogicType, AlternativeNetworkTool, AlternativeStorageType, AlternativeNavigation, AlternativeOnBackPressed, AlternativeOnActivityResult, IFlashIntegration } from "./flash/flash-app-integration"
26
-
27
- export * as ASOConfigFetch from "./aso/usage-logs/aso-config-fetch-entry"
7
+ export { IntegrationAlterations, IntegrationVersion, IApp, AppSchema, PlugType } from "./app/app"
8
+ export { IAppListItem } from "./app/app-list-item"
9
+ export { AppType } from "./app/app-type"
10
+ export { AlternativeLayoutType, AlternativeSourceType, AlternativeLogicType, AlternativeNetworkTool, AlternativeStorageType, AlternativeNavigation, AlternativeOnBackPressed, AlternativeOnActivityResult, IAppIntegration as IFlashIntegration } from "./app/app-integration"
28
11
 
29
12
  export { IPanelUser, PanelUserAccessScope, PanelUserSchema } from "./panel/user"
30
13
  export { IAuthToken } from "./panel/auth"
31
14
  export { IUpsertFlashAppRequest, IUpsertFlashAppResponse } from "./panel/flash/upsert-flash-app-request"
32
15
 
33
- export { IGradient, IStroke, IShape, ShapeDiv } from "./shared/shape"
34
- export { ColoredText, IColoredTextProps } from "./shared/colored-text"
35
- export { IOfferWallAuthConfig } from "./aso/offerwall/auth/offerwall-auth-config"
36
- export { IOfferWallAuthLocalization } from "./aso/offerwall/auth/offerwall-auth-localization"
37
- export { IOfferWallAuthSubmitRequest } from "./aso/offerwall/auth/offerwall-auth-submit-request"
38
- export { IOfferWallAuthSubmitResponse } from "./aso/offerwall/auth/offerwall-auth-submit-response"
16
+ export { IGradient, IStroke, IShape, ShapeDiv } from "./general/shape"
17
+ export { ColoredText, IColoredTextProps } from "./general/colored-text"
39
18
 
40
19
  export { KeitaroService, IKeitaroOffersFilter } from "./network/keitaro/keitaro-service"
41
20
  export * as KeitaroUtils from "./utils/keitaro-utils"
@@ -45,6 +24,6 @@ export { IKeitaroDomain } from "./keitaro/keitaro-domain"
45
24
  export { IKeitaroOffer } from "./keitaro/keitaro-offer"
46
25
  export { IKeitaroStream } from "./keitaro/keitaro-stream"
47
26
 
48
- export { ICloudflareDomainStatus, ICloudflareDomainType, ICloudflareDomain } from "./models/cloudflare-domain"
49
- export { IDomain, IDomainSetupResult, DomainStatus, DomainTarget, CONST_CLOUFLARE_STATUS_READY, IDomainsBuyRequestResponse } from "./models/domain"
50
- export { INamecheapDomain, INamecheapBuyRequest, INamecheapContactInfo, NamecheapBuyRequestSchema } from "./models/namecheap-domain"
27
+ export { ICloudflareDomainStatus, ICloudflareDomainType, ICloudflareDomain } from "./general/cloudflare-domain"
28
+ export { IDomain, IDomainSetupResult, DomainStatus, DomainTarget, CONST_CLOUFLARE_STATUS_READY, IDomainsBuyRequestResponse } from "./general/domain"
29
+ export { INamecheapDomain, INamecheapBuyRequest, INamecheapContactInfo, NamecheapBuyRequestSchema } from "./general/namecheap-domain"
@@ -1,9 +1,9 @@
1
1
  import { IKeitaroStream } from "../../keitaro/keitaro-stream";
2
- import { IOffer } from "../../shared/offer"
2
+ 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 { IFlashApp } from "../../flash/flash-app";
6
+ import { 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";
@@ -210,7 +210,7 @@ export async function upsertStreamToCampaign(campaign: IKeitaroCampaign, stream:
210
210
  }
211
211
  }
212
212
 
213
- async function cloneOWCampaign(app: IFlashApp): Promise<IKeitaroCampaign> {
213
+ async function cloneOWCampaign(app: IApp): Promise<IKeitaroCampaign> {
214
214
  let name = `FA #${app.id} (${app.bundle})`
215
215
 
216
216
  let allCampaigns = await getAllCampaigns()
@@ -242,7 +242,7 @@ async function cloneOWCampaign(app: IFlashApp): Promise<IKeitaroCampaign> {
242
242
  return campaign
243
243
  }
244
244
 
245
- async function cloneDCampaign(app: IFlashApp): Promise<IKeitaroCampaign> {
245
+ async function cloneDCampaign(app: IApp): Promise<IKeitaroCampaign> {
246
246
  let name = `D #${app.id} (${app.bundle})`
247
247
 
248
248
  let allCampaigns = await getAllCampaigns()
@@ -0,0 +1,20 @@
1
+ import { Schema } from "mongoose"
2
+
3
+ export interface ISectionsList {
4
+ id: number
5
+ content: IAppOffersSection[]
6
+ }
7
+
8
+ export interface IAppOffersSection {
9
+ sectionId: number,
10
+ offerIdsOrdered: number[]
11
+ }
12
+
13
+ export const SectionsListSchema = new Schema({
14
+ id: {
15
+ type: Number,
16
+ unique: true,
17
+ required: true
18
+ },
19
+ content: [Object],
20
+ })
@@ -0,0 +1,77 @@
1
+ import { Document, Model, Schema, model } from "mongoose";
2
+
3
+ export interface IOffer extends Document {
4
+ id: number,
5
+ name: string,
6
+ graphicFolder: string,
7
+ graphic: {
8
+ logo: string,
9
+ bg: string
10
+ }
11
+ geo: string,
12
+ caption: string,
13
+ partnerId: number,
14
+ link: string,
15
+ type: IOfferType,
16
+ keitaroId: string | null,
17
+ hidden?: boolean,
18
+ history: {
19
+ link: string[],
20
+ logo: string[],
21
+ bg: string[],
22
+ name: string[],
23
+ caption: string[]
24
+ }
25
+ }
26
+
27
+ // TODO в момент синхронізації з кейтаро підтягнути потрібні властивості
28
+ // можна було б завантажувати офер з кейтаро кожен раз, але це буде повільніше
29
+ // і доведеться назад на сервер закидати айді, який по факту там і має лежати
30
+
31
+ export interface IPartner {
32
+ partnerId: number,
33
+ shortName: string,
34
+ name: string,
35
+ }
36
+
37
+ export enum IOfferType {
38
+ GAMBLING = "gambling",
39
+ BETTING = "betting",
40
+ FIN = "fin",
41
+ }
42
+
43
+ export interface IPartnerSection {
44
+ id: number,
45
+ name: string,
46
+ offers: IOffer[],
47
+ }
48
+
49
+ export const PartnerSchema = new Schema({
50
+ partnerId: Number,
51
+ shortName: String,
52
+ name: String
53
+ })
54
+
55
+ export const OfferSchema = new Schema({
56
+ id: { type: Number, unique: true },
57
+ name: String,
58
+ graphicFolder: String,
59
+ graphic: {
60
+ logo: String,
61
+ bg: String
62
+ },
63
+ geo: String,
64
+ caption: String,
65
+ link: String,
66
+ partnerId: Number,
67
+ type: { type: IOfferType },
68
+ keitaroId: String,
69
+ hidden: Boolean,
70
+ history: {
71
+ link: [String],
72
+ logoNames: [String],
73
+ bgNames: [String],
74
+ name: [String],
75
+ caption: [String]
76
+ }
77
+ })
@@ -0,0 +1,30 @@
1
+ import { Schema } from "mongoose"
2
+
3
+ export interface IOffersSection {
4
+ id: number,
5
+ title: {
6
+ none: string,
7
+ [key: string]: string
8
+ },
9
+ button: {
10
+ none: string,
11
+ [key: string]: string
12
+ }
13
+ }
14
+
15
+ export const OffersSectionSchema = new Schema({
16
+ id: {
17
+ type: Number,
18
+ unique: true,
19
+ required: true
20
+ },
21
+ title: Object,
22
+ button: Object
23
+ })
24
+
25
+ export enum DefaultSectionId {
26
+ GAMBLING_MAIN = 0,
27
+ BETTING_MAIN = 1,
28
+ GAMBLING_PLAYED = 2,
29
+ BETTING_PLAYED = 3
30
+ }
@@ -1,4 +1,4 @@
1
- import { IAppGenerationOptions, IAppKeitaroData, IBannerParams, IDeveloperParams, IDirectParams, IDomainParams, IOffersStubParams, IPrivacyPolicyParams, IRemoveDataParams, IntegrationVersion } from "flash/flash-app"
1
+ import { IAppGenerationOptions, IAppKeitaroData, IBannerParams, IDeveloperParams, IDirectParams, IDomainParams, IOffersStubParams, IPrivacyPolicyParams, IRemoveDataParams, IntegrationVersion } from "app/app"
2
2
  import { PlugType } from "index"
3
3
 
4
4
  export interface IUpsertFlashAppRequest {
@@ -1,6 +1,6 @@
1
1
  import { IKeitaroStream } from "../keitaro/keitaro-stream"
2
- import { IFlashApp, PlugType, } from "../flash/flash-app"
3
- import { FlashAppType } from "../flash/flash-app-type"
2
+ import { IApp, PlugType, } from "../app/app"
3
+ 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"
@@ -175,7 +175,7 @@ export let removeGeosFromAllRedirectCampaigns = async (geoToRemove: string) => {
175
175
  }
176
176
  }
177
177
 
178
- export let createOrFindFlashRedirectCampaign = async (app: IFlashApp): Promise<IKeitaroCampaign> => {
178
+ export let createOrFindFlashRedirectCampaign = async (app: IApp): Promise<IKeitaroCampaign> => {
179
179
  if (app.keitaroData && app.keitaroData?.redirectCampaignId && app.keitaroData?.redirectCampaignId != 0) {
180
180
  console.log("Already exists! Fetching...")
181
181
  let campaign = await KeitaroService.getCampaignById(app.keitaroData.redirectCampaignId)
@@ -291,7 +291,7 @@ let prepareRedirectCampaignParameters = (appId: number): IKeitaroCampaignParamet
291
291
  }
292
292
  }
293
293
 
294
- export let prepareOWCampaignParameters = (app: IFlashApp): IKeitaroCampaignParameters => {
294
+ export let prepareOWCampaignParameters = (app: IApp): IKeitaroCampaignParameters => {
295
295
  return {
296
296
  "keyword": {
297
297
  "name": "keyword",
@@ -341,7 +341,7 @@ export let prepareOWCampaignParameters = (app: IFlashApp): IKeitaroCampaignParam
341
341
  }
342
342
  }
343
343
 
344
- function createBPStreamPartialPayload(app: IFlashApp): Partial<IKeitaroStream> {
344
+ function createBPStreamPartialPayload(app: IApp): Partial<IKeitaroStream> {
345
345
  return {
346
346
  name: `Bot Protection`,
347
347
  type: "forced",
@@ -363,7 +363,7 @@ function createBPStreamPartialPayload(app: IFlashApp): Partial<IKeitaroStream> {
363
363
  }
364
364
  }
365
365
 
366
- function createDefenceMainStreamPartialPayload(app: IFlashApp): Partial<IKeitaroStream> {
366
+ function createDefenceMainStreamPartialPayload(app: IApp): Partial<IKeitaroStream> {
367
367
  return {
368
368
  name: "ALL",
369
369
  type: "regular",
@@ -376,7 +376,7 @@ function createDefenceMainStreamPartialPayload(app: IFlashApp): Partial<IKeitaro
376
376
  }
377
377
  }
378
378
 
379
- export function createOWStreamPartialPayload(app: IFlashApp): Partial<IKeitaroStream> {
379
+ export function createOWStreamPartialPayload(app: IApp): Partial<IKeitaroStream> {
380
380
  return {
381
381
  name: `OW`,
382
382
  type: "regular",
@@ -394,7 +394,7 @@ export function createOWStreamPartialPayload(app: IFlashApp): Partial<IKeitaroSt
394
394
  }
395
395
  }
396
396
 
397
- export async function createFlashCampaigns(app: IFlashApp) {
397
+ export async function createFlashCampaigns(app: IApp) {
398
398
  // Upserting Flash Redirect campaign
399
399
  let redirectCampaign = await createOrFindFlashRedirectCampaign(app)
400
400
  console.log(`Redirect campaign name:`)
@@ -417,7 +417,7 @@ export async function createFlashCampaigns(app: IFlashApp) {
417
417
  }
418
418
  }
419
419
 
420
- export async function createDirectCampaign(app: IFlashApp) {
420
+ export async function createDirectCampaign(app: IApp) {
421
421
  let campaign = await KeitaroService.cloneDCampaign(app)
422
422
 
423
423
  let stream = createDefenceMainStreamPartialPayload(app)
@@ -427,7 +427,7 @@ export async function createDirectCampaign(app: IFlashApp) {
427
427
  return campaign
428
428
  }
429
429
 
430
- export async function createOWCampaign(app: IFlashApp) {
430
+ export async function createOWCampaign(app: IApp) {
431
431
  let owCampaign = await KeitaroService.cloneOWCampaign(app)
432
432
 
433
433
  return owCampaign