@bprotsyk/aso-core 1.2.220 → 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 (74) 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/general/cloudflare-domain.d.ts +42 -0
  10. package/lib/general/cloudflare-domain.js +12 -0
  11. package/lib/general/colored-text.d.ts +7 -0
  12. package/lib/general/colored-text.js +28 -0
  13. package/lib/general/domain.d.ts +92 -0
  14. package/lib/general/domain.js +38 -0
  15. package/lib/general/namecheap-domain.d.ts +80 -0
  16. package/lib/general/namecheap-domain.js +14 -0
  17. package/lib/general/push.d.ts +6 -0
  18. package/lib/general/push.js +2 -0
  19. package/lib/general/queue.d.ts +1 -0
  20. package/lib/general/queue.js +2 -0
  21. package/lib/general/shape.d.ts +18 -0
  22. package/lib/general/shape.js +36 -0
  23. package/lib/index.d.ts +13 -32
  24. package/lib/index.js +28 -29
  25. package/lib/network/keitaro/keitaro-service.d.ts +4 -4
  26. package/lib/offers/list.d.ts +37 -0
  27. package/lib/offers/list.js +12 -0
  28. package/lib/offers/offer.d.ts +95 -0
  29. package/lib/offers/offer.js +38 -0
  30. package/lib/offers/section.d.ts +47 -0
  31. package/lib/offers/section.js +20 -0
  32. package/lib/panel/flash/upsert-flash-app-request.d.ts +1 -1
  33. package/lib/utils/keitaro-utils.d.ts +7 -7
  34. package/package.json +1 -1
  35. package/src/{flash/flash-app-integration.ts → app/app-integration.ts} +1 -1
  36. package/src/{flash/flash-app-list-item.ts → app/app-list-item.ts} +1 -1
  37. package/src/{flash/flash-app-type.ts → app/app-type.ts} +1 -1
  38. package/src/{flash/flash-app.ts → app/app.ts} +19 -9
  39. package/src/{models → general}/domain.ts +1 -1
  40. package/src/index.ts +13 -34
  41. package/src/network/keitaro/keitaro-service.ts +4 -4
  42. package/src/offers/list.ts +20 -0
  43. package/src/offers/offer.ts +77 -0
  44. package/src/offers/section.ts +30 -0
  45. package/src/panel/flash/upsert-flash-app-request.ts +1 -1
  46. package/src/utils/keitaro-utils.ts +10 -10
  47. package/src/aso/config/aso-config-v0.ts +0 -441
  48. package/src/aso/config/aso-config-v1.ts +0 -440
  49. package/src/aso/config/aso-config-v2.ts +0 -399
  50. package/src/aso/config/aso-config-v3.ts +0 -396
  51. package/src/aso/config/aso-config-v4.ts +0 -305
  52. package/src/aso/config/aso-config-v5.ts +0 -328
  53. package/src/aso/config/aso-default-config.ts +0 -67
  54. package/src/aso/config/aso-single-response.ts +0 -6
  55. package/src/aso/offer/aso-customized-offer.ts +0 -12
  56. package/src/aso/offer/aso-offer-response.ts +0 -7
  57. package/src/aso/offer/aso-offer-section.ts +0 -7
  58. package/src/aso/offer/aso-single-offer.ts +0 -5
  59. package/src/aso/offerwall/auth/offerwall-auth-config.ts +0 -17
  60. package/src/aso/offerwall/auth/offerwall-auth-localization.ts +0 -9
  61. package/src/aso/offerwall/auth/offerwall-auth-submit-request.ts +0 -3
  62. package/src/aso/offerwall/auth/offerwall-auth-submit-response.ts +0 -3
  63. package/src/aso/offerwall/offerwall-home-dialog-data.ts +0 -6
  64. package/src/aso/offerwall/offerwall-offer.ts +0 -9
  65. package/src/aso/offerwall/offerwall-response.ts +0 -7
  66. package/src/aso/offerwall/offerwall-section.ts +0 -7
  67. package/src/aso/usage-logs/aso-config-fetch-entry.ts +0 -31
  68. package/src/shared/offer.ts +0 -12
  69. /package/src/{models → general}/cloudflare-domain.ts +0 -0
  70. /package/src/{shared → general}/colored-text.tsx +0 -0
  71. /package/src/{models → general}/namecheap-domain.ts +0 -0
  72. /package/src/{shared → general}/push.ts +0 -0
  73. /package/src/{shared → general}/queue.ts +0 -0
  74. /package/src/{shared → general}/shape.tsx +0 -0
@@ -0,0 +1,53 @@
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 AlternativeNavigation {
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 declare enum AlternativeFullscreen {
29
+ INSETS = "Insets",
30
+ FLAGS = "Flags",
31
+ IMMERSIVE = "Immersive"
32
+ }
33
+ export declare enum AlternativeSourceType {
34
+ FIREBASE_REALTIME_DATABASE = "Firebase Realtime DB",
35
+ GET_RETROFIT = "From link via Retrofit",
36
+ GET_VOLLEY = "From link via Volley",
37
+ GET_HTTP_URL = "From link via HTTPUrlConnection",
38
+ DIRECT = "Directly from link"
39
+ }
40
+ export declare enum AlternativeOnBackPressed {
41
+ OLD = "Old",
42
+ NEW = "New"
43
+ }
44
+ export declare enum AlternativeOnActivityResult {
45
+ OVERRIDE = "Override",
46
+ CALLBACK = "Callback"
47
+ }
48
+ export interface IAppIntegration {
49
+ id: number;
50
+ name: string;
51
+ description: string;
52
+ alterations: [any[]];
53
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlternativeOnActivityResult = exports.AlternativeOnBackPressed = exports.AlternativeSourceType = exports.AlternativeFullscreen = exports.AlternativeLayoutType = exports.AlternativeStorageType = exports.AlternativeNavigation = 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 AlternativeNavigation;
17
+ (function (AlternativeNavigation) {
18
+ AlternativeNavigation["ACTIVITY"] = "Activity";
19
+ AlternativeNavigation["FRAGMENT_FM"] = "Fragment";
20
+ AlternativeNavigation["FRAGMENT_NAV_HOST"] = "Fragment (NavHost)";
21
+ })(AlternativeNavigation = exports.AlternativeNavigation || (exports.AlternativeNavigation = {}));
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 = {}));
36
+ var AlternativeFullscreen;
37
+ (function (AlternativeFullscreen) {
38
+ AlternativeFullscreen["INSETS"] = "Insets";
39
+ AlternativeFullscreen["FLAGS"] = "Flags";
40
+ AlternativeFullscreen["IMMERSIVE"] = "Immersive";
41
+ })(AlternativeFullscreen = exports.AlternativeFullscreen || (exports.AlternativeFullscreen = {}));
42
+ var AlternativeSourceType;
43
+ (function (AlternativeSourceType) {
44
+ AlternativeSourceType["FIREBASE_REALTIME_DATABASE"] = "Firebase Realtime DB";
45
+ AlternativeSourceType["GET_RETROFIT"] = "From link via Retrofit";
46
+ AlternativeSourceType["GET_VOLLEY"] = "From link via Volley";
47
+ AlternativeSourceType["GET_HTTP_URL"] = "From link via HTTPUrlConnection";
48
+ AlternativeSourceType["DIRECT"] = "Directly from link";
49
+ // WITHIN_WEBVIEW = "Within webview",
50
+ })(AlternativeSourceType = exports.AlternativeSourceType || (exports.AlternativeSourceType = {}));
51
+ // backpress
52
+ // activity result
53
+ // fulscreen
54
+ var AlternativeOnBackPressed;
55
+ (function (AlternativeOnBackPressed) {
56
+ AlternativeOnBackPressed["OLD"] = "Old";
57
+ AlternativeOnBackPressed["NEW"] = "New";
58
+ })(AlternativeOnBackPressed = exports.AlternativeOnBackPressed || (exports.AlternativeOnBackPressed = {}));
59
+ var AlternativeOnActivityResult;
60
+ (function (AlternativeOnActivityResult) {
61
+ AlternativeOnActivityResult["OVERRIDE"] = "Override";
62
+ AlternativeOnActivityResult["CALLBACK"] = "Callback";
63
+ })(AlternativeOnActivityResult = exports.AlternativeOnActivityResult || (exports.AlternativeOnActivityResult = {}));
@@ -0,0 +1,5 @@
1
+ export interface IAppListItem {
2
+ id: number;
3
+ bundle: string;
4
+ name: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export declare enum AppType {
2
+ GAMBLING = "gambling",
3
+ FINANCES = "finances"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppType = void 0;
4
+ var AppType;
5
+ (function (AppType) {
6
+ AppType["GAMBLING"] = "gambling";
7
+ AppType["FINANCES"] = "finances"; // do not change the order!
8
+ })(AppType = exports.AppType || (exports.AppType = {}));
@@ -0,0 +1,177 @@
1
+ import { AlternativeLayoutType, AlternativeLogicType, AlternativeNavigation, AlternativeNetworkTool, AlternativeOnActivityResult, AlternativeOnBackPressed, AlternativeSourceType, AlternativeStorageType } from "index";
2
+ import { AppType } from "./app-type";
3
+ import mongoose, { Document, Model } from "mongoose";
4
+ import { AlternativeFullscreen } from "app/app-integration";
5
+ export interface IApp 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: AppType;
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
+ remoteServerParams?: IRemoteServerParams;
29
+ domainParams: IDomainParams;
30
+ developerParams: IDeveloperParams;
31
+ offersListId: number;
32
+ }
33
+ export interface IRemoteServerParams {
34
+ ip: string;
35
+ port: string;
36
+ password: string;
37
+ }
38
+ export interface IOffersStubParams {
39
+ offersPath: string;
40
+ imagesPath: string;
41
+ }
42
+ export interface IDomainParams {
43
+ name: string;
44
+ clouflareZone: string;
45
+ }
46
+ export interface IDirectParams {
47
+ path: string;
48
+ response: string;
49
+ }
50
+ export interface IBannerParams {
51
+ dataPath: string;
52
+ imagePath: string;
53
+ imageParam: string;
54
+ linkParam: string;
55
+ showStubOnError?: boolean;
56
+ }
57
+ export interface IRemoveDataParams {
58
+ buttonText: string;
59
+ resultText: string;
60
+ errorText: string;
61
+ inputHint: string;
62
+ dark: boolean;
63
+ path: string;
64
+ callbackFunctionName: string;
65
+ toSplashAfterSuccess: boolean;
66
+ }
67
+ export interface IPrivacyPolicyParams {
68
+ showButtonQuery: string;
69
+ button?: {
70
+ text: string;
71
+ };
72
+ mustRead: boolean;
73
+ dark: boolean;
74
+ path: string;
75
+ advertisingIdQuery: string;
76
+ confirmFunctionName: string;
77
+ redirectFunctionName: string;
78
+ redirect: boolean;
79
+ }
80
+ export declare enum IntegrationVersion {
81
+ MVVM = "MVVM",
82
+ POLICY = "POLICY",
83
+ OFFER_STUB = "OFFER_STUB",
84
+ DIRECT = "DIRECT",
85
+ WEB = "WEB",
86
+ WEB_DIRECT = "WEB_DIRECT",
87
+ BANNER = "BANNER"
88
+ }
89
+ export interface IntegrationAlterations {
90
+ networkTool: AlternativeNetworkTool;
91
+ logicType: AlternativeLogicType;
92
+ navigation: AlternativeNavigation;
93
+ storageType: AlternativeStorageType;
94
+ sourceType: AlternativeSourceType;
95
+ onBackPressed: AlternativeOnBackPressed;
96
+ onActivityResult: AlternativeOnActivityResult;
97
+ layoutType: AlternativeLayoutType;
98
+ fullscreen: AlternativeFullscreen;
99
+ }
100
+ export interface IAppGenerationOptions {
101
+ splashName: string;
102
+ webViewName: string;
103
+ linkName: string;
104
+ }
105
+ export interface IDeveloperParams {
106
+ name: string;
107
+ email: string;
108
+ organization: string;
109
+ }
110
+ export interface IAppKeitaroData {
111
+ redirectCampaignId: number;
112
+ redirectCampaignName: string;
113
+ redirectCampaignAlias: string;
114
+ redirectDomainId: number;
115
+ redirectDomainName: string;
116
+ trackingCampaignId: number;
117
+ trackingCampaignName: string;
118
+ trackingCampaignAlias: string;
119
+ trackingDomainId: number;
120
+ trackingDomainName: string;
121
+ clickIdParameterName: string;
122
+ offerIdParameterName: string;
123
+ }
124
+ export declare enum PlugType {
125
+ PASTEBIN = "PASTEBIN",
126
+ GIST = "GIST",
127
+ OTHER = "OTHER"
128
+ }
129
+ export declare const AppSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
130
+ type: string;
131
+ enabled: boolean;
132
+ id: number;
133
+ bundle: string;
134
+ trackingUrl: string;
135
+ geos: string;
136
+ integrationVersion: string;
137
+ name?: string | undefined;
138
+ webInterfaceName?: string | undefined;
139
+ pushesEnabled?: boolean | undefined;
140
+ sourceUrl?: string | undefined;
141
+ integrationAlterations?: any;
142
+ removeDataParams?: any;
143
+ privacyPolicyParams?: any;
144
+ offersStubParams?: any;
145
+ bannerParams?: any;
146
+ directParams?: any;
147
+ remoteServerParams?: any;
148
+ policyUrl?: string | undefined;
149
+ onesignalAppId?: string | undefined;
150
+ onesignalRestApiKey?: string | undefined;
151
+ linkPath?: string | undefined;
152
+ generationOptions?: {
153
+ splashName?: string | undefined;
154
+ webViewName?: string | undefined;
155
+ linkName?: string | undefined;
156
+ savedName?: string | undefined;
157
+ } | undefined;
158
+ keitaroData?: {
159
+ redirectCampaignId: number;
160
+ redirectCampaignName: string;
161
+ redirectCampaignAlias: string;
162
+ redirectDomainId: number;
163
+ redirectDomainName: string;
164
+ trackingCampaignId: number;
165
+ trackingCampaignName: string;
166
+ trackingCampaignAlias: string;
167
+ trackingDomainId: number;
168
+ trackingDomainName: string;
169
+ clickIdParameterName?: string | undefined;
170
+ offerIdParameterName?: string | undefined;
171
+ } | undefined;
172
+ domainParams?: {
173
+ name?: string | undefined;
174
+ clouflareZone?: string | undefined;
175
+ } | undefined;
176
+ }>;
177
+ export declare function updateSchemaAndMoveValue(model: Model<IApp>): Promise<void>;
package/lib/app/app.js ADDED
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateSchemaAndMoveValue = exports.AppSchema = exports.PlugType = exports.IntegrationVersion = void 0;
4
+ const app_type_1 = require("./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.AppSchema = 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: app_type_1.AppType,
55
+ default: app_type_1.AppType.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
+ remoteServerParams: Object,
158
+ domainParams: {
159
+ name: {
160
+ type: String,
161
+ unique: true
162
+ },
163
+ clouflareZone: {
164
+ type: String,
165
+ unique: true
166
+ },
167
+ }
168
+ });
169
+ // TODO app type (casino / fin)
170
+ async function updateSchemaAndMoveValue(model) {
171
+ await model.syncIndexes();
172
+ let pipelineStage = [
173
+ {
174
+ // $set: {
175
+ // city: "$employee_addr.city",
176
+ // street: "$employee_addr.street",
177
+ // apartment: "$employee_addr.apartment",
178
+ // employee_addr: "$$REMOVE"
179
+ // },
180
+ $set: {
181
+ "plugStatus": "$$REMOVE",
182
+ "reservePlugStatus": "$$REMOVE",
183
+ }
184
+ }
185
+ ];
186
+ let aggregation = model.aggregate(pipelineStage);
187
+ try {
188
+ await model.collection.dropIndex("plugStatus");
189
+ }
190
+ catch (e) { }
191
+ try {
192
+ await model.collection.dropIndex("reservePlugStatus");
193
+ }
194
+ catch (e) { }
195
+ // await model.schema.dropIndex("generationOptions.keyPassword_1")
196
+ await aggregation.exec();
197
+ const updateOperation = {
198
+ $set: {
199
+ plugId: "none"
200
+ },
201
+ // $addToSet
202
+ $unset: [
203
+ "pastebinUrl",
204
+ "email",
205
+ "generationOptions.keyFileName",
206
+ "generationOptions.keyDeveloperName",
207
+ "generationOptions.keyDeveloperOrganization",
208
+ "generationOptions.keyCountryCode",
209
+ "generationOptions.keyCity",
210
+ "generationOptions.keyAlias",
211
+ "generationOptions.keyPassword",
212
+ ],
213
+ };
214
+ await model.updateMany({}, updateOperation);
215
+ }
216
+ exports.updateSchemaAndMoveValue = updateSchemaAndMoveValue;
@@ -0,0 +1,42 @@
1
+ export interface ICloudflareDomain {
2
+ id: string;
3
+ name: string;
4
+ status: string;
5
+ paused: boolean;
6
+ type: string;
7
+ development_mode: number;
8
+ name_servers: string[];
9
+ original_name_servers: string[];
10
+ original_registrar: string | null;
11
+ original_dnshost: string | null;
12
+ modified_on: Date;
13
+ created_on: Date;
14
+ }
15
+ export interface ICloudflareDomainRecord {
16
+ id: string;
17
+ zone_id: string;
18
+ zone_name: string;
19
+ name: string;
20
+ type: string;
21
+ content: string;
22
+ proxiable: boolean;
23
+ proxied: boolean;
24
+ ttl: number;
25
+ locked: boolean;
26
+ meta: {
27
+ auto_added: boolean;
28
+ managed_by_apps: boolean;
29
+ managed_by_argo_tunnel: boolean;
30
+ };
31
+ comment: string;
32
+ tags: string[];
33
+ created_on: string;
34
+ modified_on: string;
35
+ }
36
+ export declare enum ICloudflareDomainStatus {
37
+ PENDING = "pending"
38
+ }
39
+ export declare enum ICloudflareDomainType {
40
+ FULL = "full",
41
+ FLEXIBLE = "flexible"
42
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ICloudflareDomainType = exports.ICloudflareDomainStatus = void 0;
4
+ var ICloudflareDomainStatus;
5
+ (function (ICloudflareDomainStatus) {
6
+ ICloudflareDomainStatus["PENDING"] = "pending";
7
+ })(ICloudflareDomainStatus = exports.ICloudflareDomainStatus || (exports.ICloudflareDomainStatus = {}));
8
+ var ICloudflareDomainType;
9
+ (function (ICloudflareDomainType) {
10
+ ICloudflareDomainType["FULL"] = "full";
11
+ ICloudflareDomainType["FLEXIBLE"] = "flexible";
12
+ })(ICloudflareDomainType = exports.ICloudflareDomainType || (exports.ICloudflareDomainType = {}));
@@ -0,0 +1,7 @@
1
+ import { IColoredString } from 'aso/config/aso-config-v0';
2
+ export interface IColoredTextProps {
3
+ coloredText: IColoredString;
4
+ className: string;
5
+ }
6
+ export declare function ColoredText({ coloredText, className }: IColoredTextProps): import("react/jsx-runtime").JSX.Element;
7
+ export default ColoredText;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ColoredText = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const StyledColoredSpan = styled_components_1.default.span `
10
+ color: ${(props) => props.color};
11
+ display: inline;
12
+ `;
13
+ function ColoredText({ coloredText, className }) {
14
+ const { text, colors } = coloredText;
15
+ let startIndex = 0;
16
+ const spans = [];
17
+ for (const { from, to, color } of colors) {
18
+ spans.push((0, jsx_runtime_1.jsx)("span", { children: text.slice(startIndex, from) }, `text_${startIndex}`));
19
+ spans.push((0, jsx_runtime_1.jsx)(StyledColoredSpan, { color: color, children: text.slice(from, to) }, `text_${from}`));
20
+ startIndex = to;
21
+ }
22
+ if (startIndex < text.length) {
23
+ spans.push((0, jsx_runtime_1.jsx)("span", { children: text.slice(startIndex) }, `text_${startIndex}`));
24
+ }
25
+ return (0, jsx_runtime_1.jsx)("div", { className: className, children: spans });
26
+ }
27
+ exports.ColoredText = ColoredText;
28
+ exports.default = ColoredText;