@bprotsyk/aso-core 1.2.237 → 1.2.238

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 (86) hide show
  1. package/lib/app/app.d.ts +3 -2
  2. package/lib/app/app.js +2 -2
  3. package/lib/general/namecheap-domain.d.ts +1 -0
  4. package/lib/general/queue.d.ts +2 -1
  5. package/lib/general/queue.js +0 -1
  6. package/lib/general/shape.js +1 -4
  7. package/lib/index.d.ts +1 -1
  8. package/lib/index.js +1 -24
  9. package/lib/network/keitaro/http.d.ts +1 -2
  10. package/lib/network/keitaro/http.js +1 -4
  11. package/lib/network/keitaro/keitaro-service.js +1 -4
  12. package/lib/utils/keitaro-utils.js +1 -4
  13. package/lib/utils/server-util.d.ts +0 -7
  14. package/lib/utils/server-util.js +7 -68
  15. package/package.json +6 -6
  16. package/src/app/app.ts +3 -3
  17. package/src/general/domain.ts +17 -1
  18. package/src/index.ts +2 -3
  19. package/src/utils/server-util.ts +71 -194
  20. package/tsconfig.json +6 -7
  21. package/lib/aso/config/aso-config-v0.d.ts +0 -333
  22. package/lib/aso/config/aso-config-v0.js +0 -59
  23. package/lib/aso/config/aso-config-v1.d.ts +0 -330
  24. package/lib/aso/config/aso-config-v1.js +0 -58
  25. package/lib/aso/config/aso-config-v2.d.ts +0 -297
  26. package/lib/aso/config/aso-config-v2.js +0 -57
  27. package/lib/aso/config/aso-config-v3.d.ts +0 -294
  28. package/lib/aso/config/aso-config-v3.js +0 -58
  29. package/lib/aso/config/aso-config-v4.d.ts +0 -208
  30. package/lib/aso/config/aso-config-v4.js +0 -58
  31. package/lib/aso/config/aso-config-v5.d.ts +0 -227
  32. package/lib/aso/config/aso-config-v5.js +0 -58
  33. package/lib/aso/config/aso-default-config.d.ts +0 -57
  34. package/lib/aso/config/aso-default-config.js +0 -2
  35. package/lib/aso/config/aso-single-response.d.ts +0 -5
  36. package/lib/aso/config/aso-single-response.js +0 -2
  37. package/lib/aso/offer/aso-customized-offer.d.ts +0 -11
  38. package/lib/aso/offer/aso-customized-offer.js +0 -2
  39. package/lib/aso/offer/aso-offer-response.d.ts +0 -6
  40. package/lib/aso/offer/aso-offer-response.js +0 -2
  41. package/lib/aso/offer/aso-offer-section.d.ts +0 -6
  42. package/lib/aso/offer/aso-offer-section.js +0 -2
  43. package/lib/aso/offer/aso-single-offer.d.ts +0 -5
  44. package/lib/aso/offer/aso-single-offer.js +0 -2
  45. package/lib/aso/offer/config/aso-config-v0.d.ts +0 -271
  46. package/lib/aso/offer/config/aso-config-v0.js +0 -57
  47. package/lib/aso/offer/config/aso-config-v1.d.ts +0 -263
  48. package/lib/aso/offer/config/aso-config-v1.js +0 -57
  49. package/lib/aso/offer/config/aso-config-v2.d.ts +0 -230
  50. package/lib/aso/offer/config/aso-config-v2.js +0 -55
  51. package/lib/aso/offer/config/aso-config-v3.d.ts +0 -227
  52. package/lib/aso/offer/config/aso-config-v3.js +0 -56
  53. package/lib/aso/offer/config/aso-config-v4.d.ts +0 -205
  54. package/lib/aso/offer/config/aso-config-v4.js +0 -56
  55. package/lib/aso/offer/config/aso-default-config.d.ts +0 -56
  56. package/lib/aso/offer/config/aso-default-config.js +0 -2
  57. package/lib/aso/offer/config/aso-single-response.d.ts +0 -5
  58. package/lib/aso/offer/config/aso-single-response.js +0 -2
  59. package/lib/aso/offerwall/auth/offerwall-auth-config.d.ts +0 -14
  60. package/lib/aso/offerwall/auth/offerwall-auth-config.js +0 -2
  61. package/lib/aso/offerwall/auth/offerwall-auth-localization.d.ts +0 -8
  62. package/lib/aso/offerwall/auth/offerwall-auth-localization.js +0 -2
  63. package/lib/aso/offerwall/auth/offerwall-auth-submit-request.d.ts +0 -3
  64. package/lib/aso/offerwall/auth/offerwall-auth-submit-request.js +0 -2
  65. package/lib/aso/offerwall/auth/offerwall-auth-submit-response.d.ts +0 -3
  66. package/lib/aso/offerwall/auth/offerwall-auth-submit-response.js +0 -2
  67. package/lib/aso/offerwall/offerwall-home-dialog-data.d.ts +0 -6
  68. package/lib/aso/offerwall/offerwall-home-dialog-data.js +0 -2
  69. package/lib/aso/offerwall/offerwall-offer.d.ts +0 -8
  70. package/lib/aso/offerwall/offerwall-offer.js +0 -2
  71. package/lib/aso/offerwall/offerwall-response.d.ts +0 -6
  72. package/lib/aso/offerwall/offerwall-response.js +0 -2
  73. package/lib/aso/offerwall/offerwall-section.d.ts +0 -6
  74. package/lib/aso/offerwall/offerwall-section.js +0 -2
  75. package/lib/aso/usage-logs/aso-config-fetch-entry.d.ts +0 -28
  76. package/lib/aso/usage-logs/aso-config-fetch-entry.js +0 -2
  77. package/lib/flash/flash-app-integration.d.ts +0 -53
  78. package/lib/flash/flash-app-integration.js +0 -63
  79. package/lib/flash/flash-app-list-item.d.ts +0 -5
  80. package/lib/flash/flash-app-list-item.js +0 -2
  81. package/lib/flash/flash-app-type.d.ts +0 -4
  82. package/lib/flash/flash-app-type.js +0 -8
  83. package/lib/flash/flash-app.d.ts +0 -169
  84. package/lib/flash/flash-app.js +0 -215
  85. package/src/templates/nginx-template.conf +0 -35
  86. package/src/types/ssh2-sftp-client.d.ts +0 -59
@@ -1,169 +0,0 @@
1
- import { AlternativeLayoutType, AlternativeLogicType, AlternativeNavigation, AlternativeNetworkTool, AlternativeOnActivityResult, AlternativeOnBackPressed, AlternativeSourceType, AlternativeStorageType } from "../index";
2
- import { FlashAppType } from "./flash-app-type";
3
- import mongoose, { Document, Model } from "mongoose";
4
- import { AlternativeFullscreen } from "../flash/flash-app-integration";
5
- export interface IFlashApp extends Document {
6
- id: number;
7
- enabled: boolean;
8
- name: string;
9
- trackingUrl?: string;
10
- bundle: string;
11
- pushesEnabled?: boolean;
12
- sourceUrl?: string;
13
- policyUrl?: string;
14
- type: FlashAppType;
15
- geos: string;
16
- onesignalAppId: string;
17
- onesignalRestApiKey: string;
18
- webInterfaceName: string;
19
- generationOptions: IAppGenerationOptions;
20
- keitaroData: IAppKeitaroData | null;
21
- integrationVersion: IntegrationVersion;
22
- integrationAlterations?: IntegrationAlterations;
23
- removeDataParams?: IRemoveDataParams;
24
- privacyPolicyParams?: IPrivacyPolicyParams;
25
- offersStubParams?: IOffersStubParams;
26
- directParams?: IDirectParams;
27
- bannerParams?: IBannerParams;
28
- domainParams: IDomainParams;
29
- developerParams: IDeveloperParams;
30
- }
31
- export interface IOffersStubParams {
32
- offersPath: string;
33
- imagesPath: string;
34
- }
35
- export interface IDomainParams {
36
- name: string;
37
- clouflareZone: string;
38
- }
39
- export interface IDirectParams {
40
- path: string;
41
- response: string;
42
- }
43
- export interface IBannerParams {
44
- dataPath: string;
45
- imagePath: string;
46
- imageParam: string;
47
- linkParam: string;
48
- showStubOnError?: boolean;
49
- }
50
- export interface IRemoveDataParams {
51
- buttonText: string;
52
- resultText: string;
53
- errorText: string;
54
- inputHint: string;
55
- dark: boolean;
56
- path: string;
57
- callbackFunctionName: string;
58
- toSplashAfterSuccess: boolean;
59
- }
60
- export interface IPrivacyPolicyParams {
61
- showButtonQuery: string;
62
- button?: {
63
- text: string;
64
- };
65
- mustRead: boolean;
66
- dark: boolean;
67
- path: string;
68
- advertisingIdQuery: string;
69
- confirmFunctionName: string;
70
- redirectFunctionName: string;
71
- redirect: boolean;
72
- }
73
- export declare enum IntegrationVersion {
74
- MVVM = "MVVM",
75
- POLICY = "POLICY",
76
- OFFER_STUB = "OFFER_STUB",
77
- DIRECT = "DIRECT",
78
- WEB = "WEB",
79
- WEB_DIRECT = "WEB_DIRECT",
80
- BANNER = "BANNER"
81
- }
82
- export interface IntegrationAlterations {
83
- networkTool: AlternativeNetworkTool;
84
- logicType: AlternativeLogicType;
85
- navigation: AlternativeNavigation;
86
- storageType: AlternativeStorageType;
87
- sourceType: AlternativeSourceType;
88
- onBackPressed: AlternativeOnBackPressed;
89
- onActivityResult: AlternativeOnActivityResult;
90
- layoutType: AlternativeLayoutType;
91
- fullscreen: AlternativeFullscreen;
92
- }
93
- export interface IAppGenerationOptions {
94
- splashName: string;
95
- webViewName: string;
96
- linkName: string;
97
- }
98
- export interface IDeveloperParams {
99
- name: string;
100
- email: string;
101
- organization: string;
102
- }
103
- export interface IAppKeitaroData {
104
- redirectCampaignId: number;
105
- redirectCampaignName: string;
106
- redirectCampaignAlias: string;
107
- redirectDomainId: number;
108
- redirectDomainName: string;
109
- trackingCampaignId: number;
110
- trackingCampaignName: string;
111
- trackingCampaignAlias: string;
112
- trackingDomainId: number;
113
- trackingDomainName: string;
114
- clickIdParameterName: string;
115
- offerIdParameterName: string;
116
- }
117
- export declare enum PlugType {
118
- PASTEBIN = "PASTEBIN",
119
- GIST = "GIST",
120
- OTHER = "OTHER"
121
- }
122
- export declare const FlashAppSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
123
- type: string;
124
- enabled: boolean;
125
- id: number;
126
- bundle: string;
127
- trackingUrl: string;
128
- geos: string;
129
- integrationVersion: string;
130
- name?: string | undefined;
131
- webInterfaceName?: string | undefined;
132
- pushesEnabled?: boolean | undefined;
133
- sourceUrl?: string | undefined;
134
- integrationAlterations?: any;
135
- removeDataParams?: any;
136
- privacyPolicyParams?: any;
137
- offersStubParams?: any;
138
- bannerParams?: any;
139
- directParams?: any;
140
- policyUrl?: string | undefined;
141
- onesignalAppId?: string | undefined;
142
- onesignalRestApiKey?: string | undefined;
143
- linkPath?: string | undefined;
144
- generationOptions?: {
145
- splashName?: string | undefined;
146
- webViewName?: string | undefined;
147
- linkName?: string | undefined;
148
- savedName?: string | undefined;
149
- } | undefined;
150
- keitaroData?: {
151
- redirectCampaignId: number;
152
- redirectCampaignName: string;
153
- redirectCampaignAlias: string;
154
- redirectDomainId: number;
155
- redirectDomainName: string;
156
- trackingCampaignId: number;
157
- trackingCampaignName: string;
158
- trackingCampaignAlias: string;
159
- trackingDomainId: number;
160
- trackingDomainName: string;
161
- clickIdParameterName?: string | undefined;
162
- offerIdParameterName?: string | undefined;
163
- } | undefined;
164
- domainParams?: {
165
- name?: string | undefined;
166
- clouflareZone?: string | undefined;
167
- } | undefined;
168
- }>;
169
- export declare function updateSchemaAndMoveValue(model: Model<IFlashApp>): Promise<void>;
@@ -1,215 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateSchemaAndMoveValue = exports.FlashAppSchema = exports.PlugType = exports.IntegrationVersion = void 0;
4
- const flash_app_type_1 = require("./flash-app-type");
5
- const mongoose_1 = require("mongoose");
6
- const util = require("util");
7
- var IntegrationVersion;
8
- (function (IntegrationVersion) {
9
- IntegrationVersion["MVVM"] = "MVVM";
10
- IntegrationVersion["POLICY"] = "POLICY";
11
- IntegrationVersion["OFFER_STUB"] = "OFFER_STUB";
12
- IntegrationVersion["DIRECT"] = "DIRECT";
13
- IntegrationVersion["WEB"] = "WEB";
14
- IntegrationVersion["WEB_DIRECT"] = "WEB_DIRECT";
15
- IntegrationVersion["BANNER"] = "BANNER";
16
- })(IntegrationVersion = exports.IntegrationVersion || (exports.IntegrationVersion = {}));
17
- var PlugType;
18
- (function (PlugType) {
19
- PlugType["PASTEBIN"] = "PASTEBIN";
20
- PlugType["GIST"] = "GIST";
21
- PlugType["OTHER"] = "OTHER";
22
- })(PlugType = exports.PlugType || (exports.PlugType = {}));
23
- exports.FlashAppSchema = new mongoose_1.Schema({
24
- id: {
25
- type: Number,
26
- unique: true,
27
- required: true
28
- },
29
- enabled: {
30
- type: Boolean,
31
- required: true,
32
- default: false
33
- },
34
- bundle: {
35
- type: String,
36
- unique: true,
37
- required: true
38
- },
39
- name: String,
40
- trackingUrl: {
41
- type: String,
42
- default: null
43
- },
44
- webInterfaceName: String,
45
- pushesEnabled: Boolean,
46
- sourceUrl: String,
47
- policyUrl: {
48
- type: String,
49
- // unique: true,
50
- required: false
51
- },
52
- type: {
53
- type: String,
54
- enum: flash_app_type_1.FlashAppType,
55
- default: flash_app_type_1.FlashAppType.GAMBLING
56
- },
57
- geos: {
58
- type: String,
59
- required: true
60
- },
61
- onesignalAppId: {
62
- type: String,
63
- required: false
64
- },
65
- onesignalRestApiKey: {
66
- type: String,
67
- required: false
68
- },
69
- linkPath: {
70
- type: String
71
- },
72
- integrationVersion: {
73
- type: String,
74
- default: IntegrationVersion.OFFER_STUB,
75
- enum: IntegrationVersion
76
- },
77
- integrationAlterations: Object,
78
- generationOptions: {
79
- splashName: {
80
- type: String,
81
- },
82
- webViewName: {
83
- type: String,
84
- },
85
- linkName: {
86
- type: String,
87
- },
88
- savedName: {
89
- type: String,
90
- },
91
- },
92
- keitaroData: {
93
- redirectCampaignId: {
94
- type: Number,
95
- // unique: true,
96
- required: true,
97
- default: 0
98
- },
99
- redirectCampaignName: {
100
- type: String,
101
- // unique: true,
102
- required: true,
103
- default: "none"
104
- },
105
- redirectCampaignAlias: {
106
- type: String,
107
- // unique: true,
108
- required: true,
109
- default: "none"
110
- },
111
- redirectDomainId: {
112
- type: Number,
113
- required: true,
114
- default: 0
115
- },
116
- redirectDomainName: {
117
- type: String,
118
- required: true,
119
- default: "none"
120
- },
121
- trackingCampaignId: {
122
- type: Number,
123
- // unique: true,
124
- required: true,
125
- default: 0
126
- },
127
- trackingCampaignName: {
128
- type: String,
129
- // unique: true,
130
- required: true,
131
- default: "none"
132
- },
133
- trackingCampaignAlias: {
134
- type: String,
135
- // unique: true,
136
- required: true,
137
- default: "none"
138
- },
139
- trackingDomainId: {
140
- type: Number,
141
- required: true,
142
- default: 0
143
- },
144
- trackingDomainName: {
145
- type: String,
146
- required: true,
147
- default: "none"
148
- },
149
- clickIdParameterName: String,
150
- offerIdParameterName: String,
151
- },
152
- removeDataParams: Object,
153
- privacyPolicyParams: Object,
154
- offersStubParams: Object,
155
- bannerParams: Object,
156
- directParams: Object,
157
- domainParams: {
158
- name: {
159
- type: String,
160
- unique: true
161
- },
162
- clouflareZone: {
163
- type: String,
164
- unique: true
165
- },
166
- }
167
- });
168
- // TODO app type (casino / fin)
169
- async function updateSchemaAndMoveValue(model) {
170
- await model.syncIndexes();
171
- let pipelineStage = [
172
- {
173
- // $set: {
174
- // city: "$employee_addr.city",
175
- // street: "$employee_addr.street",
176
- // apartment: "$employee_addr.apartment",
177
- // employee_addr: "$$REMOVE"
178
- // },
179
- $set: {
180
- "plugStatus": "$$REMOVE",
181
- "reservePlugStatus": "$$REMOVE",
182
- }
183
- }
184
- ];
185
- let aggregation = model.aggregate(pipelineStage);
186
- try {
187
- await model.collection.dropIndex("plugStatus");
188
- }
189
- catch (e) { }
190
- try {
191
- await model.collection.dropIndex("reservePlugStatus");
192
- }
193
- catch (e) { }
194
- // await model.schema.dropIndex("generationOptions.keyPassword_1")
195
- await aggregation.exec();
196
- const updateOperation = {
197
- $set: {
198
- plugId: "none"
199
- },
200
- // $addToSet
201
- $unset: [
202
- "pastebinUrl",
203
- "email",
204
- "generationOptions.keyFileName",
205
- "generationOptions.keyDeveloperName",
206
- "generationOptions.keyDeveloperOrganization",
207
- "generationOptions.keyCountryCode",
208
- "generationOptions.keyCity",
209
- "generationOptions.keyAlias",
210
- "generationOptions.keyPassword",
211
- ],
212
- };
213
- await model.updateMany({}, updateOperation);
214
- }
215
- exports.updateSchemaAndMoveValue = updateSchemaAndMoveValue;
@@ -1,35 +0,0 @@
1
- server {
2
- server_name {{domain}};
3
- listen 80;
4
-
5
- return 301 https://{{domain}}$request_uri;
6
- }
7
-
8
- server {
9
- listen 443 ssl;
10
-
11
- ssl_certificate "/etc/letsencrypt/live/{{domain}}/fullchain.pem";
12
- ssl_certificate_key "/etc/letsencrypt/live/{{domain}}/privkey.pem";
13
- ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
14
- ssl_prefer_server_ciphers on;
15
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
16
- add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
17
- ssl_stapling on;
18
-
19
- error_log /var/log/nginx/{{domain}}.error.log error;
20
-
21
- root {{rootPath}}{{domain}};
22
- error_page 404 /policy/index.html;
23
-
24
- server_name www.{{domain}} {{domain}};
25
-
26
- location / {
27
- root {{rootPath}}{{domain}};
28
- add_header 'Access-Control-Allow-Origin' '*';
29
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
30
- add_header 'Access-Control-Allow-Headers' 'Origin, Authorization, Accept, Content-Type, X-Requested-With';
31
- if ($request_method = 'OPTIONS') {
32
- return 204;
33
- }
34
- }
35
- }
@@ -1,59 +0,0 @@
1
- declare module 'ssh2-sftp-client' {
2
- import { Client, ConnectConfig, SFTPWrapper } from 'ssh2';
3
-
4
-
5
-
6
-
7
- interface ExtendedConnectConfig extends ConnectConfig {
8
- host: string;
9
- port?: number;
10
- forceIPv4?: boolean;
11
- forceIPv6?: boolean;
12
- keepaliveCountMax?: number;
13
- keepaliveInterval?: number;
14
- readyTimeout?: number;
15
- strictVendor?: boolean;
16
- username?: string;
17
- password?: string;
18
- agent?: string;
19
- privateKey?: string | Buffer;
20
- passphrase?: string;
21
- tryKeyboard?: boolean;
22
- }
23
-
24
- interface Stats {
25
- mode: number;
26
- permissions: number;
27
- owner: {
28
- user: number;
29
- group: number;
30
- };
31
- size: number;
32
- accessTime: Date;
33
- modifyTime: Date;
34
- isDirectory: boolean;
35
- isFile: boolean;
36
- isBlockDevice: boolean;
37
- isCharacterDevice: boolean;
38
- isSymbolicLink: boolean;
39
- isFIFO: boolean;
40
- isSocket: boolean;
41
- }
42
-
43
- interface SFTPClient {
44
- connect(options: ExtendedConnectConfig): Promise<SFTPWrapper>;
45
- list(remotePath: string): Promise<Stats[]>;
46
- get(remotePath: string, dst?: string | NodeJS.WritableStream): Promise<string | Buffer | NodeJS.WritableStream>;
47
- put(src: string | Buffer | NodeJS.ReadableStream, remotePath: string): Promise<void>;
48
- delete(remotePath: string): Promise<void>;
49
- mkdir(remotePath: string, recursive?: boolean): Promise<void>;
50
- rmdir(remotePath: string, recursive?: boolean): Promise<void>;
51
- end(): Promise<void>;
52
- }
53
-
54
- const SFTPClient: {
55
- new(): SFTPClient;
56
- };
57
-
58
- export = SFTPClient;
59
- }