@bprotsyk/aso-core 1.2.90 → 1.2.91

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.
@@ -0,0 +1,33 @@
1
+ export declare enum AlternativeNetworkTool {
2
+ RETROFIT = "Retrofit",
3
+ VOLLEY = "Volley",
4
+ HTTP_URL = "HTTPUrlConnection"
5
+ }
6
+ export declare enum AlternativeLogicType {
7
+ CALLBACKS = "Callback",
8
+ RX = "RX",
9
+ COROUTINES = "Coroutines"
10
+ }
11
+ export declare enum AlternativeWebViewType {
12
+ ACTIVITY = "Activity",
13
+ FRAGMENT_FM = "Fragment",
14
+ FRAGMENT_NAV_HOST = "Fragment (NavHost)"
15
+ }
16
+ export declare enum AlternativeStorageType {
17
+ FILE = "File",
18
+ ROOM = "Room",
19
+ ENCRYPTED_PREFS = "Encrypted Preferences",
20
+ SHARED_PREFERENCES = "Shared Preferences",
21
+ CONTENT_PROVIDER = "Content Provider"
22
+ }
23
+ export declare enum AlternativeLayoutType {
24
+ DATA_BINDING = "DataBinding",
25
+ BY_ID = "findViewById",
26
+ PROGRAMATICALLY = "Create in code"
27
+ }
28
+ export interface IFlashIntegration {
29
+ id: number;
30
+ name: string;
31
+ description: string;
32
+ alterations: [any[]];
33
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlternativeLayoutType = exports.AlternativeStorageType = exports.AlternativeWebViewType = exports.AlternativeLogicType = exports.AlternativeNetworkTool = void 0;
4
+ var AlternativeNetworkTool;
5
+ (function (AlternativeNetworkTool) {
6
+ AlternativeNetworkTool["RETROFIT"] = "Retrofit";
7
+ AlternativeNetworkTool["VOLLEY"] = "Volley";
8
+ AlternativeNetworkTool["HTTP_URL"] = "HTTPUrlConnection";
9
+ })(AlternativeNetworkTool = exports.AlternativeNetworkTool || (exports.AlternativeNetworkTool = {}));
10
+ var AlternativeLogicType;
11
+ (function (AlternativeLogicType) {
12
+ AlternativeLogicType["CALLBACKS"] = "Callback";
13
+ AlternativeLogicType["RX"] = "RX";
14
+ AlternativeLogicType["COROUTINES"] = "Coroutines";
15
+ })(AlternativeLogicType = exports.AlternativeLogicType || (exports.AlternativeLogicType = {}));
16
+ var AlternativeWebViewType;
17
+ (function (AlternativeWebViewType) {
18
+ AlternativeWebViewType["ACTIVITY"] = "Activity";
19
+ AlternativeWebViewType["FRAGMENT_FM"] = "Fragment";
20
+ AlternativeWebViewType["FRAGMENT_NAV_HOST"] = "Fragment (NavHost)";
21
+ })(AlternativeWebViewType = exports.AlternativeWebViewType || (exports.AlternativeWebViewType = {}));
22
+ var AlternativeStorageType;
23
+ (function (AlternativeStorageType) {
24
+ AlternativeStorageType["FILE"] = "File";
25
+ AlternativeStorageType["ROOM"] = "Room";
26
+ AlternativeStorageType["ENCRYPTED_PREFS"] = "Encrypted Preferences";
27
+ AlternativeStorageType["SHARED_PREFERENCES"] = "Shared Preferences";
28
+ AlternativeStorageType["CONTENT_PROVIDER"] = "Content Provider";
29
+ })(AlternativeStorageType = exports.AlternativeStorageType || (exports.AlternativeStorageType = {}));
30
+ var AlternativeLayoutType;
31
+ (function (AlternativeLayoutType) {
32
+ AlternativeLayoutType["DATA_BINDING"] = "DataBinding";
33
+ AlternativeLayoutType["BY_ID"] = "findViewById";
34
+ AlternativeLayoutType["PROGRAMATICALLY"] = "Create in code";
35
+ })(AlternativeLayoutType = exports.AlternativeLayoutType || (exports.AlternativeLayoutType = {}));
package/lib/index.d.ts CHANGED
@@ -19,19 +19,3 @@ export { IOfferWallHomeDialogData } from "./aso/offerwall/offerwall-home-dialog-
19
19
  export { IFlashApp, FlashAppSchema, updateSchemaAndMoveValue, PlugType, FlashAppPlugStatus } from "./flash/flash-app";
20
20
  export { IFlashAppListItem } from "./flash/flash-app-list-item";
21
21
  export { FlashAppType } from "./flash/flash-app-type";
22
- export * as ASOConfigFetch from "./aso/usage-logs/aso-config-fetch-entry";
23
- export { IPanelUser, PanelUserAccessScope, PanelUserSchema } from "./panel/user";
24
- export { IAuthToken } from "./panel/auth";
25
- export { IUpsertFlashAppRequest, IUpsertFlashAppResponse } from "./panel/flash/create-flash-app-request";
26
- export { IGradient, IStroke, IShape, ShapeDiv } from "./shared/shape";
27
- export { ColoredText, IColoredTextProps } from "./shared/colored-text";
28
- export { IOfferWallAuthConfig } from "./aso/offerwall/auth/offerwall-auth-config";
29
- export { IOfferWallAuthLocalization } from "./aso/offerwall/auth/offerwall-auth-localization";
30
- export { IOfferWallAuthSubmitRequest } from "./aso/offerwall/auth/offerwall-auth-submit-request";
31
- export { IOfferWallAuthSubmitResponse } from "./aso/offerwall/auth/offerwall-auth-submit-response";
32
- export { KeitaroService } from "./network/keitaro/keitaro-service";
33
- export * as KeitaroUtils from "./utils/keitaro-utils";
34
- export { IKeitaroCampaign, IKeitaroCampaignParameters, IKeitaroCampaignParameter } from "./keitaro/keitaro-campaign";
35
- export { IKeitaroDomain } from "./keitaro/keitaro-domain";
36
- export { IKeitaroOffer } from "./keitaro/keitaro-offer";
37
- export { IKeitaroStream } from "./keitaro/keitaro-stream";
package/lib/index.js CHANGED
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.KeitaroUtils = exports.KeitaroService = exports.ColoredText = exports.ShapeDiv = exports.PanelUserSchema = exports.PanelUserAccessScope = exports.ASOConfigFetch = exports.FlashAppType = exports.FlashAppPlugStatus = exports.PlugType = exports.updateSchemaAndMoveValue = exports.FlashAppSchema = exports.ASO_v5 = exports.ASO_v4 = exports.ASO_v3 = exports.ASO_v2 = exports.ASO_v1 = exports.ASO_v0 = void 0;
26
+ exports.FlashAppType = exports.FlashAppPlugStatus = exports.PlugType = exports.updateSchemaAndMoveValue = exports.FlashAppSchema = exports.ASO_v5 = exports.ASO_v4 = exports.ASO_v3 = exports.ASO_v2 = exports.ASO_v1 = exports.ASO_v0 = void 0;
27
27
  exports.ASO_v0 = __importStar(require("./aso/config/aso-config-v0"));
28
28
  exports.ASO_v1 = __importStar(require("./aso/config/aso-config-v1"));
29
29
  exports.ASO_v2 = __importStar(require("./aso/config/aso-config-v2"));
@@ -37,14 +37,26 @@ Object.defineProperty(exports, "PlugType", { enumerable: true, get: function ()
37
37
  Object.defineProperty(exports, "FlashAppPlugStatus", { enumerable: true, get: function () { return flash_app_1.FlashAppPlugStatus; } });
38
38
  var flash_app_type_1 = require("./flash/flash-app-type");
39
39
  Object.defineProperty(exports, "FlashAppType", { enumerable: true, get: function () { return flash_app_type_1.FlashAppType; } });
40
- exports.ASOConfigFetch = __importStar(require("./aso/usage-logs/aso-config-fetch-entry"));
41
- var user_1 = require("./panel/user");
42
- Object.defineProperty(exports, "PanelUserAccessScope", { enumerable: true, get: function () { return user_1.PanelUserAccessScope; } });
43
- Object.defineProperty(exports, "PanelUserSchema", { enumerable: true, get: function () { return user_1.PanelUserSchema; } });
44
- var shape_1 = require("./shared/shape");
45
- Object.defineProperty(exports, "ShapeDiv", { enumerable: true, get: function () { return shape_1.ShapeDiv; } });
46
- var colored_text_1 = require("./shared/colored-text");
47
- Object.defineProperty(exports, "ColoredText", { enumerable: true, get: function () { return colored_text_1.ColoredText; } });
48
- var keitaro_service_1 = require("./network/keitaro/keitaro-service");
49
- Object.defineProperty(exports, "KeitaroService", { enumerable: true, get: function () { return keitaro_service_1.KeitaroService; } });
50
- exports.KeitaroUtils = __importStar(require("./utils/keitaro-utils"));
40
+ `
41
+ export { AlternativeLayoutType, AlternativeLogicType, AlternativeNetworkTool, AlternativeStorageType, AlternativeWebViewType, IFlashIntegration } from "./flash/flash-app-integration"
42
+
43
+ export * as ASOConfigFetch from "./aso/usage-logs/aso-config-fetch-entry"
44
+
45
+ export { IPanelUser, PanelUserAccessScope, PanelUserSchema } from "./panel/user"
46
+ export { IAuthToken } from "./panel/auth"
47
+ export { IUpsertFlashAppRequest, IUpsertFlashAppResponse } from "./panel/flash/create-flash-app-request"
48
+
49
+ export { IGradient, IStroke, IShape, ShapeDiv } from "./shared/shape"
50
+ export { ColoredText, IColoredTextProps } from "./shared/colored-text"
51
+ export { IOfferWallAuthConfig } from "./aso/offerwall/auth/offerwall-auth-config"
52
+ export { IOfferWallAuthLocalization } from "./aso/offerwall/auth/offerwall-auth-localization"
53
+ export { IOfferWallAuthSubmitRequest } from "./aso/offerwall/auth/offerwall-auth-submit-request"
54
+ export { IOfferWallAuthSubmitResponse } from "./aso/offerwall/auth/offerwall-auth-submit-response"
55
+
56
+ export { KeitaroService } from "./network/keitaro/keitaro-service"
57
+ export * as KeitaroUtils from "./utils/keitaro-utils"
58
+
59
+ export {IKeitaroCampaign, IKeitaroCampaignParameters, IKeitaroCampaignParameter} from "./keitaro/keitaro-campaign"
60
+ export {IKeitaroDomain} from "./keitaro/keitaro-domain"
61
+ export {IKeitaroOffer} from "./keitaro/keitaro-offer"
62
+ export {IKeitaroStream} from "./keitaro/keitaro-stream";
@@ -9,6 +9,7 @@ declare function cloneStreams(originalCampaignId: number, streamPositionsToClone
9
9
  declare function updateCampaign(id: number, payload: Partial<IKeitaroCampaign>): Promise<void>;
10
10
  declare function getAllOffers(): Promise<any[]>;
11
11
  declare function getOfferByKeitaroId(id: number): Promise<any>;
12
+ declare function updateOffer(offer: any): Promise<any>;
12
13
  declare function addOfferToKeitaro(offer: IOffer, affiliateId: number, link: string, groupId?: number): Promise<void>;
13
14
  declare function createCampaign(campaignData: Partial<IKeitaroCampaign>): Promise<IKeitaroCampaign>;
14
15
  declare function getCampaignById(id: number): Promise<IKeitaroCampaign>;
@@ -28,5 +29,6 @@ export declare const KeitaroService: {
28
29
  getCampaignById: typeof getCampaignById;
29
30
  upsertStreamToCampaign: typeof upsertStreamToCampaign;
30
31
  cloneOWCampaign: typeof cloneOWCampaign;
32
+ updateOffer: typeof updateOffer;
31
33
  };
32
34
  export {};
@@ -86,6 +86,10 @@ async function getOfferByKeitaroId(id) {
86
86
  const { data: offer } = await http_1.default.get(`offers/${id}`);
87
87
  return offer;
88
88
  }
89
+ async function updateOffer(offer) {
90
+ const { data: o } = await http_1.default.put(`offers/${offer.id}`, offer);
91
+ return o;
92
+ }
89
93
  function createStreamPartialPayload(keitaroOfferId, offerName, offerId, offerGeo) {
90
94
  return {
91
95
  name: `${offerName} ${offerGeo} (${offerId})`,
@@ -187,5 +191,6 @@ async function getDomains(onlyActive) {
187
191
  return onlyActive ? domains.filter((d) => d.network_status == "active") : domains;
188
192
  }
189
193
  exports.KeitaroService = {
190
- getStreamsByCampaignId, updateCampaign, getAllCampaigns, getAllOffers, cloneStreams, addOfferToKeitaro, getOfferByKeitaroId, getDomains, createCampaign, getCampaignById, upsertStreamToCampaign, cloneOWCampaign
194
+ getStreamsByCampaignId, updateCampaign, getAllCampaigns, getAllOffers, cloneStreams, addOfferToKeitaro, getOfferByKeitaroId, getDomains, createCampaign, getCampaignById, upsertStreamToCampaign, cloneOWCampaign,
195
+ updateOffer
191
196
  };
@@ -380,6 +380,16 @@ let changeSourceForFA = async () => {
380
380
  });
381
381
  }
382
382
  };
383
+ let replaceDomainInOffers = async (oldDomain, newDomain, offerNameRegEx) => {
384
+ let offers = await keitaro_service_1.KeitaroService.getAllOffers();
385
+ offers = offers.filter((o) => offerNameRegEx.exec(o.name));
386
+ for (let offer of offers) {
387
+ console.log(offer);
388
+ // offer.action_payload = offer.action_payload.replace(oldDomain, newDomain)
389
+ // await sleep(700)
390
+ // await KeitaroService.updateOffer(offer)
391
+ }
392
+ };
383
393
  let gatherInfoForFlashApps = async () => {
384
394
  console.log(__dirname);
385
395
  const pasteMap = JSON.parse(await readFile('/Users/bprtsk/Documents/Work/ASO/AI Control Panel /AI Panel Core/src/utils/map-paste.json', 'utf8'));
@@ -469,3 +479,4 @@ let gatherInfoForFlashApps = async () => {
469
479
  // addGeosToAllRedirectCam`paigns("GR")
470
480
  // removeGeosFromAllRedirectCampaigns("BE`")
471
481
  // gatherInfoForFlashApps()
482
+ replaceDomainInOffers(`mariorel.com`, `xmariorel.com`, /Icecasino Huffson.*/g);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "1.2.90",
3
+ "version": "1.2.91",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -0,0 +1,38 @@
1
+ export enum AlternativeNetworkTool {
2
+ RETROFIT = "Retrofit",
3
+ VOLLEY = "Volley",
4
+ HTTP_URL = "HTTPUrlConnection",
5
+ }
6
+
7
+ export enum AlternativeLogicType {
8
+ CALLBACKS = "Callback",
9
+ RX = "RX",
10
+ COROUTINES = "Coroutines",
11
+ }
12
+
13
+ export enum AlternativeWebViewType {
14
+ ACTIVITY = "Activity",
15
+ FRAGMENT_FM = "Fragment",
16
+ FRAGMENT_NAV_HOST = "Fragment (NavHost)",
17
+ }
18
+
19
+ export enum AlternativeStorageType {
20
+ FILE = "File",
21
+ ROOM = "Room",
22
+ ENCRYPTED_PREFS = "Encrypted Preferences",
23
+ SHARED_PREFERENCES = "Shared Preferences",
24
+ CONTENT_PROVIDER = "Content Provider",
25
+ }
26
+
27
+ export enum AlternativeLayoutType {
28
+ DATA_BINDING = "DataBinding",
29
+ BY_ID = "findViewById",
30
+ PROGRAMATICALLY = "Create in code"
31
+ }
32
+
33
+ export interface IFlashIntegration {
34
+ id: number,
35
+ name: string,
36
+ description: string,
37
+ alterations: [any[]]
38
+ }
package/src/index.ts CHANGED
@@ -21,7 +21,8 @@ export { IOfferWallHomeDialogData } from "./aso/offerwall/offerwall-home-dialog-
21
21
 
22
22
  export { IFlashApp, FlashAppSchema, updateSchemaAndMoveValue, PlugType, FlashAppPlugStatus } from "./flash/flash-app"
23
23
  export { IFlashAppListItem } from "./flash/flash-app-list-item"
24
- export { FlashAppType } from "./flash/flash-app-type"
24
+ export { FlashAppType } from "./flash/flash-app-type"`
25
+ export { AlternativeLayoutType, AlternativeLogicType, AlternativeNetworkTool, AlternativeStorageType, AlternativeWebViewType, IFlashIntegration } from "./flash/flash-app-integration"
25
26
 
26
27
  export * as ASOConfigFetch from "./aso/usage-logs/aso-config-fetch-entry"
27
28
 
@@ -104,6 +104,12 @@ async function getOfferByKeitaroId(id: number): Promise<any> {
104
104
  return offer
105
105
  }
106
106
 
107
+ async function updateOffer(offer: any): Promise<any> {
108
+ const { data: o } = await keitaroApi.put<any>(`offers/${offer.id}`, offer)
109
+
110
+ return o
111
+ }
112
+
107
113
  function createStreamPartialPayload(keitaroOfferId: number, offerName: string, offerId: string, offerGeo: string) {
108
114
  return {
109
115
  name: `${offerName} ${offerGeo} (${offerId})`,
@@ -224,5 +230,6 @@ async function getDomains(onlyActive?: boolean): Promise<IKeitaroDomain[]> {
224
230
  }
225
231
 
226
232
  export const KeitaroService = {
227
- getStreamsByCampaignId, updateCampaign, getAllCampaigns, getAllOffers, cloneStreams, addOfferToKeitaro, getOfferByKeitaroId, getDomains, createCampaign, getCampaignById, upsertStreamToCampaign, cloneOWCampaign
233
+ getStreamsByCampaignId, updateCampaign, getAllCampaigns, getAllOffers, cloneStreams, addOfferToKeitaro, getOfferByKeitaroId, getDomains, createCampaign, getCampaignById, upsertStreamToCampaign, cloneOWCampaign,
234
+ updateOffer
228
235
  }
@@ -388,6 +388,20 @@ let changeSourceForFA = async () => {
388
388
  }
389
389
  }
390
390
 
391
+ let replaceDomainInOffers = async (oldDomain: string, newDomain: string, offerNameRegEx: RegExp)=> {
392
+ let offers = await KeitaroService.getAllOffers()
393
+
394
+ offers = offers.filter((o) => offerNameRegEx.exec(o.name))
395
+
396
+ for (let offer of offers) {
397
+ console.log(offer)
398
+ // offer.action_payload = offer.action_payload.replace(oldDomain, newDomain)
399
+
400
+ // await sleep(700)
401
+ // await KeitaroService.updateOffer(offer)
402
+ }
403
+ }
404
+
391
405
  let gatherInfoForFlashApps = async () => {
392
406
  console.log(__dirname)
393
407
  const pasteMap: PasteMap = JSON.parse(await readFile('/Users/bprtsk/Documents/Work/ASO/AI Control Panel /AI Panel Core/src/utils/map-paste.json', 'utf8'));
@@ -498,4 +512,6 @@ let gatherInfoForFlashApps = async () => {
498
512
  // addGeosToAllRedirectCam`paigns("GR")
499
513
  // removeGeosFromAllRedirectCampaigns("BE`")
500
514
 
501
- // gatherInfoForFlashApps()
515
+ // gatherInfoForFlashApps()
516
+
517
+ replaceDomainInOffers(`mariorel.com`, `xmariorel.com`, /Icecasino Huffson.*/g)