@maka/maka-cli 4.10.0 → 4.10.2
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/bundle/obf/package.json +1 -1
- package/bundle/obf/src/command.js +1 -1
- package/bundle/obf/src/commands/_index.js +1 -1
- package/bundle/obf/src/commands/ai.js +1 -1
- package/bundle/obf/src/commands/aws/_index.js +1 -1
- package/bundle/obf/src/commands/aws/aws.command.js +1 -1
- package/bundle/obf/src/commands/aws/chz.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/ci.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/ckp.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/csg.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/di.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/dkp.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/dsg.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/rbi.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/rdn.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/rkp.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/sth.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/ti.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/build/_index.js +1 -1
- package/bundle/obf/src/commands/build/build.js +1 -1
- package/bundle/obf/src/commands/build/docker.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/create.js +1 -1
- package/bundle/obf/src/commands/debug.js +1 -1
- package/bundle/obf/src/commands/deploy/_index.js +1 -1
- package/bundle/obf/src/commands/deploy/deploy.command.js +1 -1
- package/bundle/obf/src/commands/deploy/galaxy.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/deploy/ubuntu.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/game/_index.js +1 -1
- package/bundle/obf/src/commands/game/battleship.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/game/play.command.js +1 -1
- package/bundle/obf/src/commands/game/pong.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/command.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/drop.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/equip.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/go.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/lock.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/look.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/say.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/search.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/solve.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/take.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/unequip.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/unlock.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/commands/use.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/factories/commandF.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/factories/roomsF.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/game.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/models/_index.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/models/door.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/models/inventory.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/models/item.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/models/npc.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/models/player.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/models/puzzle.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/models/room.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/models/scene.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/scenes/items.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/scenes/rooms.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/types/abstracts.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/types/enums.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/types/interfaces.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/types/types.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/ui.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest/utilities/logger.js +1 -1
- package/bundle/obf/src/commands/game/sideQuest.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/game/snake.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/game/tetris.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/generate.js +1 -1
- package/bundle/obf/src/commands/get/_index.js +1 -1
- package/bundle/obf/src/commands/get/get.command.js +1 -1
- package/bundle/obf/src/commands/get/global.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/get/local.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/get/whoami.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/help.js +1 -1
- package/bundle/obf/src/commands/install.js +1 -1
- package/bundle/obf/src/commands/jsdoc.js +1 -1
- package/bundle/obf/src/commands/lint.js +1 -1
- package/bundle/obf/src/commands/login.js +1 -1
- package/bundle/obf/src/commands/logout.js +1 -1
- package/bundle/obf/src/commands/logs.js +1 -1
- package/bundle/obf/src/commands/maka.cmd.js +1 -1
- package/bundle/obf/src/commands/murder.js +1 -1
- package/bundle/obf/src/commands/patreon.js +1 -1
- package/bundle/obf/src/commands/proxy.js +1 -1
- package/bundle/obf/src/commands/reconfig.js +1 -1
- package/bundle/obf/src/commands/register.js +1 -1
- package/bundle/obf/src/commands/run/_index.js +1 -1
- package/bundle/obf/src/commands/run/docker.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/run/run.command.js +1 -1
- package/bundle/obf/src/commands/set/_index.js +1 -1
- package/bundle/obf/src/commands/set/global.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/set/local.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/set/set.command.js +1 -1
- package/bundle/obf/src/commands/ssh.js +1 -1
- package/bundle/obf/src/commands/ssl.js +1 -1
- package/bundle/obf/src/commands/test.js +1 -1
- package/bundle/obf/src/commands/undo.js +1 -1
- package/bundle/obf/src/commands/version.js +1 -1
- package/bundle/obf/src/error.js +1 -1
- package/bundle/obf/src/exec.js +1 -1
- package/bundle/obf/src/generator.js +1 -1
- package/bundle/obf/src/generators/_index.js +1 -1
- package/bundle/obf/src/generators/api.js +1 -1
- package/bundle/obf/src/generators/collection.js +1 -1
- package/bundle/obf/src/generators/component.js +1 -1
- package/bundle/obf/src/generators/config.js +1 -1
- package/bundle/obf/src/generators/dbc.js +1 -1
- package/bundle/obf/src/generators/dockerfile.js +1 -1
- package/bundle/obf/src/generators/hook.js +1 -1
- package/bundle/obf/src/generators/kits/_index.js +1 -1
- package/bundle/obf/src/generators/kits/esri/_index.js +1 -1
- package/bundle/obf/src/generators/kits/esri/esri.generator.js +1 -1
- package/bundle/obf/src/generators/kits/esri/map.esri.gen.js +1 -1
- package/bundle/obf/src/generators/kits/kit.js +1 -1
- package/bundle/obf/src/generators/kits/mui/_index.js +1 -1
- package/bundle/obf/src/generators/kits/mui/frame.mui.gen.js +1 -1
- package/bundle/obf/src/generators/kits/mui/mui.generator.js +1 -1
- package/bundle/obf/src/generators/layout.js +1 -1
- package/bundle/obf/src/generators/maka.gen.js +1 -1
- package/bundle/obf/src/generators/methods.js +1 -1
- package/bundle/obf/src/generators/package.js +1 -1
- package/bundle/obf/src/generators/page.js +1 -1
- package/bundle/obf/src/generators/publish.js +1 -1
- package/bundle/obf/src/generators/route.js +1 -1
- package/bundle/obf/src/generators/service.js +1 -1
- package/bundle/obf/src/generators/services/_index.js +1 -1
- package/bundle/obf/src/generators/services/openssl.js +1 -1
- package/bundle/obf/src/generators/services/translation.js +1 -1
- package/bundle/obf/src/maka.js +1 -1
- package/bundle/obf/src/templates/meteor/app/maka.d.ts +344 -0
- package/bundle/obf/src/templates/meteor/app/meteor.d.ts +0 -1
- package/bundle/obf/src/templates/react/component/component.js.tsx +0 -1
- package/bundle/obf/src/tool.js +1 -1
- package/bundle/obf/src/tools/actions/actions.class.js +1 -1
- package/bundle/obf/src/tools/aws/aws.class.js +1 -1
- package/bundle/obf/src/tools/aws/aws.interfaces.js +1 -1
- package/bundle/obf/src/tools/docker/docker.class.js +1 -1
- package/bundle/obf/src/tools/docker/docker.interfaces.js +1 -1
- package/bundle/obf/src/tools/fsi/fsi.class.js +1 -1
- package/bundle/obf/src/tools/fsi/fsi.interfaces.js +1 -1
- package/bundle/obf/src/tools/https/https.class.js +1 -1
- package/bundle/obf/src/tools/https/https.interface.js +1 -1
- package/bundle/obf/src/tools/log/log.class.js +1 -1
- package/bundle/obf/src/tools/log/log.interfaces.js +1 -1
- package/bundle/obf/src/tools/options/options.class.js +1 -1
- package/bundle/obf/src/tools/progress/progress.class.js +1 -1
- package/bundle/obf/src/tools/spawn-async/spawn-async.class.js +1 -1
- package/bundle/obf/src/tools/spawn-async/spawn-async.interfaces.js +1 -1
- package/bundle/obf/src/tools/ssh/ssh.class.js +1 -1
- package/bundle/obf/src/tools/ssh/ssh.interfaces.js +1 -1
- package/bundle/obf/src/tools/ssl/ssl.class.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,349 @@
|
|
|
1
1
|
interface Window { cordova: any; }
|
|
2
2
|
|
|
3
|
+
declare module 'meteor/maka:http' {
|
|
4
|
+
export const HTTP: {
|
|
5
|
+
/**
|
|
6
|
+
* Namespace for HTTP functionalities on the server.
|
|
7
|
+
*/
|
|
8
|
+
server: typeof HTTPServer;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Namespace for HTTP functionalities on the server.
|
|
12
|
+
*/
|
|
13
|
+
client: typeof HTTPClient;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Namespace for HTTP.call on client or server.
|
|
17
|
+
*/
|
|
18
|
+
call: typeof HTTPClient.call | typeof HTTPServer.call;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Namespace for HTTP functionalities shared by both server and client.
|
|
22
|
+
*/
|
|
23
|
+
del: typeof HTTPCommon.del;
|
|
24
|
+
get: typeof HTTPCommon.get;
|
|
25
|
+
post: typeof HTTPCommon.post;
|
|
26
|
+
put: typeof HTTPCommon.put;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Namespace for HTTP functionalities on the server.
|
|
31
|
+
*/
|
|
32
|
+
namespace HTTPServer {
|
|
33
|
+
/**
|
|
34
|
+
* Represents the options for an HTTP call on the server.
|
|
35
|
+
* @typeparam T The type of the `data` field in the options, default is `any`.
|
|
36
|
+
*/
|
|
37
|
+
interface Options<T = any> {
|
|
38
|
+
data?: T;
|
|
39
|
+
params?: { [key: string]: any };
|
|
40
|
+
headers?: { [key: string]: string };
|
|
41
|
+
timeout?: number;
|
|
42
|
+
retryDelay?: number;
|
|
43
|
+
maxRetries?: number;
|
|
44
|
+
rawResponse?: boolean;
|
|
45
|
+
followRedirects?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Performs an HTTP call on the server.
|
|
50
|
+
* @param method The HTTP method (e.g., 'GET', 'POST').
|
|
51
|
+
* @param url The URL to which the request is sent.
|
|
52
|
+
* @param options The options for the HTTP request.
|
|
53
|
+
* @returns A promise that resolves with the HTTP response.
|
|
54
|
+
*/
|
|
55
|
+
function call(
|
|
56
|
+
method: string,
|
|
57
|
+
url: string,
|
|
58
|
+
optionsOrCallback?: HTTPServer.Options | ((error: any, result?: HTTPCommon.HTTPResponse) => void),
|
|
59
|
+
callback?: (error: any, result?: HTTPCommon.HTTPResponse) => void
|
|
60
|
+
): Promise<HTTPCommon.HTTPResponse>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Namespace for HTTP functionalities on the client.
|
|
65
|
+
*/
|
|
66
|
+
namespace HTTPClient {
|
|
67
|
+
/**
|
|
68
|
+
* Represents the options for an HTTP call on the client.
|
|
69
|
+
* @typeparam T The type of the `data` field in the options, default is `any`.
|
|
70
|
+
*/
|
|
71
|
+
interface Options<T = any> {
|
|
72
|
+
data?: T;
|
|
73
|
+
params?: { [key: string]: any };
|
|
74
|
+
headers?: { [key: string]: string };
|
|
75
|
+
rawResponse?: boolean;
|
|
76
|
+
retryDelay?: number;
|
|
77
|
+
maxRetries?: number;
|
|
78
|
+
timeout?: number;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Performs an HTTP call on the client.
|
|
83
|
+
* @param method The HTTP method (e.g., 'GET', 'POST').
|
|
84
|
+
* @param url The URL to which the request is sent.
|
|
85
|
+
* @param options The options for the HTTP request.
|
|
86
|
+
* @returns A promise that resolves with the HTTP response.
|
|
87
|
+
*/
|
|
88
|
+
function call(
|
|
89
|
+
method: string,
|
|
90
|
+
url: string,
|
|
91
|
+
optionsOrCallback?: HTTPClient.Options | ((error: any, result?: HTTPCommon.HTTPResponse) => void),
|
|
92
|
+
callback?: (error: any, result?: HTTPCommon.HTTPResponse) => void
|
|
93
|
+
): Promise<HTTPCommon.HTTPResponse>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Common namespace for HTTP functionalities shared by both server and client.
|
|
98
|
+
*/
|
|
99
|
+
namespace HTTPCommon {
|
|
100
|
+
/**
|
|
101
|
+
* Represents the HTTP response returned by an HTTP call.
|
|
102
|
+
* @typeparam T The type of the `data` field in the response, default is `any`.
|
|
103
|
+
*/
|
|
104
|
+
interface HTTPResponse<T = any> {
|
|
105
|
+
statusCode: number;
|
|
106
|
+
headers: { [id: string]: string };
|
|
107
|
+
data: T;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface RequestInterceptor {
|
|
111
|
+
(
|
|
112
|
+
method: string,
|
|
113
|
+
url: string,
|
|
114
|
+
optionsOrCallback?: HTTPServer.Options | HTTPClient.Options | ((error: any, result?: HTTPCommon.HTTPResponse) => void),
|
|
115
|
+
callback?: (error: any, result?: HTTPCommon.HTTPResponse) => void
|
|
116
|
+
): Promise<{ method: string, url: string; options: HTTPServer.Options | HTTPClient.Options }>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface ResponseInterceptor {
|
|
120
|
+
(response: HTTPCommon.HTTPResponse): Promise<HTTPCommon.HTTPResponse>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Documentation for del, get, post, put follows a similar pattern.
|
|
124
|
+
function del<T = any>(
|
|
125
|
+
url: string,
|
|
126
|
+
optionsOrCallback?: HTTPServer.Options | HTTPClient.Options | ((error: any, result?: HTTPCommon.HTTPResponse) => void),
|
|
127
|
+
callback?: (error: any, result?: HTTPCommon.HTTPResponse) => void
|
|
128
|
+
): Promise<HTTPCommon.HTTPResponse<T>>;
|
|
129
|
+
function get<T = any>(
|
|
130
|
+
url: string,
|
|
131
|
+
optionsOrCallback?: HTTPServer.Options | HTTPClient.Options | ((error: any, result?: HTTPCommon.HTTPResponse) => void),
|
|
132
|
+
callback?: (error: any, result?: HTTPCommon.HTTPResponse) => void
|
|
133
|
+
): Promise<HTTPCommon.HTTPResponse<T>>;
|
|
134
|
+
function post<T = any>(
|
|
135
|
+
url: string,
|
|
136
|
+
optionsOrCallback?: HTTPServer.Options | HTTPClient.Options | ((error: any, result?: HTTPCommon.HTTPResponse) => void),
|
|
137
|
+
callback?: (error: any, result?: HTTPCommon.HTTPResponse) => void
|
|
138
|
+
): Promise<HTTPCommon.HTTPResponse<T>>;
|
|
139
|
+
function put<T = any>(
|
|
140
|
+
url: string,
|
|
141
|
+
optionsOrCallback?: HTTPServer.Options | HTTPClient.Options | ((error: any, result?: HTTPCommon.HTTPResponse) => void),
|
|
142
|
+
callback?: (error: any, result?: HTTPCommon.HTTPResponse) => void
|
|
143
|
+
): Promise<HTTPCommon.HTTPResponse<T>>;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
declare module 'meteor/maka:rest' {
|
|
149
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
150
|
+
import { RateLimiterMemory, RateLimiterRedis, IRateLimiterOptions } from 'rate-limiter-flexible';
|
|
151
|
+
import { RedisClientType } from '@redis/client';
|
|
152
|
+
import { Meteor } from 'meteor/meteor';
|
|
153
|
+
|
|
154
|
+
export type LoginType = 'default' | null;
|
|
155
|
+
|
|
156
|
+
export interface MakaRestOptions {
|
|
157
|
+
debug?: boolean;
|
|
158
|
+
paths: string[];
|
|
159
|
+
apiRoot: string; // Root of the API, e.g., 'api'
|
|
160
|
+
apiPath?: string; // Additional path after the version, required unless isRoot is true
|
|
161
|
+
version: string; // API version, e.g., 'v1'
|
|
162
|
+
isRoot?: boolean; // If true, this instance represents the root of the API
|
|
163
|
+
prettyJson: boolean;
|
|
164
|
+
auth: {
|
|
165
|
+
token: string;
|
|
166
|
+
user: (http: IncomingMessage) => { token?: string };
|
|
167
|
+
};
|
|
168
|
+
defaultHeaders: Record<string, string>;
|
|
169
|
+
enableCors: boolean;
|
|
170
|
+
defaultOptionsEndpoint?: () => RouteOptions;
|
|
171
|
+
rateLimitOptions?: IRateLimiterOptions
|
|
172
|
+
& {
|
|
173
|
+
useRedis?: boolean;
|
|
174
|
+
redis?: RedisClientType;
|
|
175
|
+
keyGenerator?: (req: Request) => string;
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export default class MakaRest {
|
|
180
|
+
private readonly _routes: Route[];
|
|
181
|
+
private readonly _config: MakaRestOptions;
|
|
182
|
+
private readonly rateLimiter?: RateLimiterMemory | RateLimiterRedis;
|
|
183
|
+
private readonly partialApiPath: string;
|
|
184
|
+
static defaultAuthInitialized: boolean;
|
|
185
|
+
request: Request;
|
|
186
|
+
response: Response;
|
|
187
|
+
constructor(options: Partial<MakaRestOptions>);
|
|
188
|
+
|
|
189
|
+
static interceptorType: (req: IncomingMessage, res: Response, next: Function) => void;
|
|
190
|
+
static interceptors: Array<typeof MakaRest.interceptorType>;
|
|
191
|
+
static addInterceptor(interceptor: typeof MakaRest.interceptorType): void;
|
|
192
|
+
static executeInterceptors(req: IncomingMessage, res: Response, next: Function, index?: number): void;
|
|
193
|
+
static auth: {
|
|
194
|
+
loginType: LoginType;
|
|
195
|
+
onLoggedIn: (req: IncomingMessage) => void;
|
|
196
|
+
onLoggedOut: (req: IncomingMessage) => void;
|
|
197
|
+
onLoginFailure: (req: IncomingMessage, reason?: string) => void;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
private configureCors(): void;
|
|
201
|
+
private normalizeApiPath(options: Partial<MakaRestOptions>): string;
|
|
202
|
+
private initializeWildcardRoutes(): void;
|
|
203
|
+
private initializeDefaultAuthEndpoints(): void;
|
|
204
|
+
private login(incomingMessage: IncomingMessage): Promise<StatusResponse>;
|
|
205
|
+
private logout(incomingMessage: IncomingMessage): Promise<StatusResponse>;
|
|
206
|
+
private logoutAll(incomingMessage: IncomingMessage): Promise<StatusResponse>;
|
|
207
|
+
|
|
208
|
+
addRoute(path: string, options: RouteOptions, endpoints?: { [method: string]: EndpointOptions }): void;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface Password {
|
|
212
|
+
digest: string;
|
|
213
|
+
algorithm: 'sha-256';
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface AuthToken {
|
|
217
|
+
authToken: string;
|
|
218
|
+
userId: string;
|
|
219
|
+
when: Date;
|
|
220
|
+
error?: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface BodyParams {
|
|
224
|
+
username?: string;
|
|
225
|
+
email?: string;
|
|
226
|
+
password: string;
|
|
227
|
+
hashed?: boolean;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export class Auth {
|
|
231
|
+
static loginWithPassword(user: Partial<Meteor.User>, password: string | Password): Promise<AuthToken>;
|
|
232
|
+
private static validateUser(user: Partial<Meteor.User>): void;
|
|
233
|
+
private static validatePassword(password: string | Password): void;
|
|
234
|
+
static getUserQuerySelector(user: Partial<Meteor.User>): Partial<Meteor.User>;
|
|
235
|
+
static extractUser(body: BodyParams): Partial<Meteor.User>;
|
|
236
|
+
static extractPassword(body: BodyParams): string | Password;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface StatusResponse {
|
|
240
|
+
statusCode: number;
|
|
241
|
+
status: string;
|
|
242
|
+
data: any;
|
|
243
|
+
headers?: Record<string, string>;
|
|
244
|
+
extra?: any;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export class Codes {
|
|
248
|
+
private static generateResponse(statusCode: number, body: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
249
|
+
static continue100(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
250
|
+
static success200(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
251
|
+
static success201(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
252
|
+
static noContent204(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
253
|
+
static movedPermanently301(redirectUrl: string, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
254
|
+
static badRequest400(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
255
|
+
static unauthorized401(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
256
|
+
static forbidden403(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
257
|
+
static notFound404(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
258
|
+
static notAllowed405(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
259
|
+
static unsupported415(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
260
|
+
static teapot418(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
261
|
+
static tooManyRequests429(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
262
|
+
static serverError500(body?: any, extra?: any, headers?: Record<string, string>): StatusResponse;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export interface RouteHandler {
|
|
266
|
+
method: string;
|
|
267
|
+
path: string;
|
|
268
|
+
handler: (req: IncomingMessage, res: ServerResponse) => void;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface Middleware {
|
|
272
|
+
(req: IncomingMessage, res: ServerResponse, next: Function): void;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export class JsonRoutes {
|
|
276
|
+
private static instance: JsonRoutes;
|
|
277
|
+
private routes: RouteHandler[];
|
|
278
|
+
private middlewares: Middleware[];
|
|
279
|
+
private errorMiddlewares: Middleware[];
|
|
280
|
+
private responseHeaders: Record<string, string>;
|
|
281
|
+
|
|
282
|
+
private constructor();
|
|
283
|
+
|
|
284
|
+
public static getInstance(): JsonRoutes;
|
|
285
|
+
public static add(method: string, path: string, handler: (req: IncomingMessage, res: ServerResponse) => void): void;
|
|
286
|
+
public static use(middleware: Middleware): void;
|
|
287
|
+
public static useErrorMiddleware(middleware: Middleware): void;
|
|
288
|
+
public static setResponseHeaders(headers: Record<string, string>): void;
|
|
289
|
+
public static sendResult(res: ServerResponse, options: { code?: number; headers?: Record<string, string>; data?: any }): void;
|
|
290
|
+
private setHeaders(res: ServerResponse, headers: Record<string, string>): void;
|
|
291
|
+
private writeJsonToBody(res: ServerResponse, json: any): void;
|
|
292
|
+
private matchRoute(req: IncomingMessage): RouteHandler | undefined;
|
|
293
|
+
private parseJsonBody(req: IncomingMessage): Promise<any>;
|
|
294
|
+
private processRequest(req: IncomingMessage, res: ServerResponse): Promise<void>;
|
|
295
|
+
private routeRequest(req: IncomingMessage, res: ServerResponse): void;
|
|
296
|
+
private handleError(error: any, res: ServerResponse): void;
|
|
297
|
+
public static processRoutes(apiRoot: string): void;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface EndpointContext {
|
|
301
|
+
urlParams: any;
|
|
302
|
+
queryParams: any;
|
|
303
|
+
bodyParams: any;
|
|
304
|
+
request: Request;
|
|
305
|
+
response: Response;
|
|
306
|
+
done: () => void;
|
|
307
|
+
user?: Meteor.User;
|
|
308
|
+
userId?: string;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export interface EndpointOptions {
|
|
312
|
+
authRequired?: boolean;
|
|
313
|
+
roleRequired?: string[];
|
|
314
|
+
scopeRequired?: string[];
|
|
315
|
+
action: (context: EndpointContext) => Promise<any>;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface RouteOptions {
|
|
319
|
+
[key: string]: any; // Define specific routes here (e.g., get, post, put, del)
|
|
320
|
+
rateLimit?: {
|
|
321
|
+
points?: number;
|
|
322
|
+
duration?: number;
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export class Route {
|
|
327
|
+
private api: MakaRest;
|
|
328
|
+
private path: string;
|
|
329
|
+
private options: RouteOptions;
|
|
330
|
+
private endpoints: { [method: string]: EndpointOptions };
|
|
331
|
+
private jsonRoutes: JsonRoutes;
|
|
332
|
+
private rateLimiter?: RateLimiterMemory | RateLimiterRedis;
|
|
333
|
+
|
|
334
|
+
constructor(api: MakaRest, path: string, options: RouteOptions, endpoints: { [method: string]: EndpointOptions });
|
|
335
|
+
|
|
336
|
+
addToApi(onRoot?: boolean): void;
|
|
337
|
+
|
|
338
|
+
private _resolveEndpoints(): void;
|
|
339
|
+
private _configureEndpoints(): void;
|
|
340
|
+
private _callEndpoint(endpointContext: EndpointContext, endpoint: EndpointOptions): Promise<StatusResponse>;
|
|
341
|
+
private _authAccepted(endpointContext: EndpointContext, endpoint: EndpointOptions): Promise<{ success: boolean; data?: any }>;
|
|
342
|
+
private _authenticate(endpointContext: EndpointContext): Promise<{ success: boolean; data?: any }>;
|
|
343
|
+
private _roleAccepted(endpointContext: EndpointContext, endpoint: EndpointOptions): boolean;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
3
347
|
declare module "react" {
|
|
4
348
|
interface React {
|
|
5
349
|
let Component:TODO;
|
|
@@ -15,7 +15,6 @@ declare let Meteor: any;
|
|
|
15
15
|
|
|
16
16
|
// TODO: These should be worked out ...
|
|
17
17
|
declare module 'meteor/react-meteor-data';
|
|
18
|
-
declare module 'meteor/maka:rest';
|
|
19
18
|
declare module 'meteor/mdg:validated-method';
|
|
20
19
|
declare module 'meteor/apollo';
|
|
21
20
|
declare module 'meteor/server-render';
|
package/bundle/obf/src/tool.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a129K=a129d;(function(a,b){const I=a129d,c=a();while(!![]){try{const d=parseInt(I(0x209))/0x1*(parseInt(I(0x1d0))/0x2)+parseInt(I(0x20c))/0x3+parseInt(I(0x1f7))/0x4*(parseInt(I(0x1f0))/0x5)+parseInt(I(0x1ee))/0x6*(-parseInt(I(0x204))/0x7)+-parseInt(I(0x1c9))/0x8+-parseInt(I(0x1db))/0x9+parseInt(I(0x1f2))/0xa;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a129c,0xed388));const a129b=(function(){let a=!![];return function(b,c){const d=a?function(){if(c){const e=c['apply'](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a129a=a129b(this,function(){const J=a129d;return a129a[J(0x1d2)]()['search']('(((.+)+)+)+$')[J(0x1d2)]()[J(0x1e1)](a129a)[J(0x1ff)](J(0x1de));});function a129d(a,b){const c=a129c();return a129d=function(d,e){d=d-0x1c9;let f=c[d];return f;},a129d(a,b);}a129a();import a129e from'path';import a129f from'os';import a129g from'fs';const homeDir=a129f[a129K(0x1cc)]();import{Docker}from'./tools/docker/docker.class.js';import{FSI}from'./tools/fsi/fsi.class.js';function a129c(){const a0=['Please\x20choose\x20an\x20environment','string','(((.+)+)+)+$','guest','usage','constructor','length','exit','description','engines','Local','map','You\x20must\x20have\x20','remapShortToLong','help','charAt','ask','To\x20use\x20this\x20generator,\x20\x22','10308mWOfnU','disableAuthCheck','3950FKGVUW','To\x20use\x20this\x20command,\x20\x22','1676080dBWSBk','join','cwd','resourceName','Invalid\x20argument:\x20','9120bHmTvR','Please\x20choose\x20a\x20valid\x20value\x20for\x20','Invalid\x20value\x20for\x20','Invalid\x20option:\x20','getMakaProjectConfig','match','keys','roles','search','env','validateMakaSubscription','Please\x20provide\x20a\x20valid\x20argument\x20for\x20','indexOf','952XeMTQp','fsi','error','find','getShortName','1lLdtlB','examples','proCommands','134142ZZOCOR','user','getAppProjectConfigs','isGenerator','win32','shortDesc','docker','findProjectDirectory','getPro','NIE','push','options','list','None','validateEngines','aliases','concat','includes','1149312ebfzAo','parent','validateUserIsLoggedIn','homedir','validateMakaProject','Please\x20choose\x20a\x20value\x20for\x20','Please\x20provide\x20a\x20value\x20for\x20','1563868nWwIYA','root','toString','isCommand','\x20installed\x20to\x20use\x20this\x20command.','existsSync','name','validateParams','.meteor','proGenerators','formatToNamedParam','13018392jWuPrv'];a129c=function(){return a0;};return a129c();}import{Log}from'./tools/log/log.class.js';import{Actions}from'./tools/actions/actions.class.js';import{UsageError}from'./error.js';export class Tool{[a129K(0x212)];[a129K(0x205)];['options'];[a129K(0x1d6)];[a129K(0x1ca)];['_handler'];constructor(){this['docker']=new Docker(),this['fsi']=new FSI();}[a129K(0x208)](a){const L=a129K;return a[L(0x1eb)](0x0);}[a129K(0x1e9)](a,b){const M=a129K,c=this[M(0x1da)](b),d={...a};for(const e of c){const f=this[M(0x208)](e[M(0x1d6)]);a[f]&&(d[e['name']]=a[f],delete d[f]);}return d;}[a129K(0x1da)](a){const N=a129K;if(a['every'](b=>typeof b===N(0x1dd)))return a[N(0x1e7)](b=>({'name':b}));return a;}['match'](a){const O=a129K,b=[this[O(0x1d6)]][O(0x21c)](this[O(0x217)]['aliases']||[]);return this['parent']&&b[O(0x216)](this[O(0x1ca)]),b[O(0x21d)](a);}[a129K(0x1cd)](){const P=a129K,a=this['fsi'][P(0x213)]();return a!==![]?!![]:![];}async[a129K(0x1cb)](){const Q=a129K,a=await this['fsi']['getPro']();return a?.[Q(0x20d)]&&a?.[Q(0x20d)]!==Q(0x1df)?!![]:![];}['validateMeteorInstall'](){const R=a129K;let a=a129e[R(0x1f3)](homeDir,R(0x1d8));const b=process['platform']===R(0x210);if(b){a=a129e[R(0x1f3)](homeDir,'AppData',R(0x1e6),'.meteor');if(!a129g[R(0x1d5)](a))return![];}else{if(!a129g[R(0x1d5)](a))return![];}return!![];}[a129K(0x21a)](a){const S=a129K,b=this[S(0x205)][S(0x1fb)](),c=b[S(0x1e5)],d=Object[S(0x1fd)](a);if(d[S(0x1e2)]>0x0)for(const e of d){const f=c[e];if(f!==a[e]){Log['error'](S(0x1e8)+e+'\x20version\x20'+a[e]+S(0x1d4));throw UsageError;}}}async[a129K(0x1d7)](a,b,c){const T=a129K,{requiredOpts:d,validArgs:e,validOpts:f,noNeedResource:g}=c,h=Object[T(0x1fd)](b);if(h[T(0x21d)](T(0x1f5))&&b[T(0x1f5)]===undefined&&!g){const m=await Actions[T(0x1ec)]('Please\x20provide\x20a\x20resource\x20name:');b[T(0x1f5)]=m;}let i=[],j=b;if(d){i=this[T(0x1da)](d),j=this['remapShortToLong'](b,i);if(i&&i?.[T(0x1e2)]>0x0)for(const n of i){const {name:o,values:p,regex:q}=n;if(!Object[T(0x1fd)](j)[T(0x21d)](o)){if(o==='env'){const r=this['fsi'][T(0x20e)](),s=await Actions[T(0x217)]({'type':T(0x218),'name':T(0x200),'message':T(0x1dc),'choices':r});b[T(0x200)]=s[T(0x200)];}else{const t=p;if(t){const u=await Actions[T(0x217)]({'type':T(0x218),'name':o,'message':T(0x1ce)+o,'choices':p});b[o]=u[o];}else{if(q){const v=await Actions['ask'](T(0x1cf)+o);if(v[T(0x1fc)](q))b[o]=v;else{Log[T(0x206)](T(0x1f9)+o+':\x20'+v);throw new UsageError();}}else{const w=await Actions[T(0x1ec)]('Please\x20provide\x20a\x20value\x20for\x20'+o);b[o]=w;}}}}else{const x=j[o];if(p&&!p['includes'](x)){Log[T(0x206)]('Invalid\x20value\x20for\x20'+o+':\x20'+x);throw new UsageError();}}}}let k=this[T(0x1da)](f),l=b;if(k&&Object['keys'](k)?.['length']>0x0){k=k[T(0x21c)](i||[]),k[T(0x216)]({'name':T(0x1f5),'hidden':!![]}),k[T(0x216)]({'name':T(0x1ea),'boolFlag':!![]}),k[T(0x216)]({'name':'dir','hidden':!![]}),k[T(0x216)]({'name':T(0x1f4),'hidden':!![]}),k[T(0x216)]({'name':T(0x1d1),'hidden':!![]}),k[T(0x216)]({'name':'config','hidden':!![]}),l=this[T(0x1e9)](b,k);for(const y of k){const {name:z,values:A}=y,B=l[z];if(B!==undefined&&(!A||!A[T(0x21d)](B))){const C=A;if(C){const D=await Actions[T(0x217)]({'type':T(0x218),'name':z,'message':T(0x1f8)+z,'choices':A});l[z]=D[z];}}if(k['length']>0x0)for(const E of Object['keys'](l)){const F=k[T(0x207)](G=>G[T(0x1d6)]===E);if(!F){Log[T(0x206)](T(0x1fa)+E);throw new UsageError();}}}}if(e&&e?.[T(0x1e2)]>0x0)for(const G of e){if(!e['includes'](G)){Log[T(0x206)](T(0x1f6)+G);const H=await Actions[T(0x1ec)](T(0x202)+G);a[a[T(0x203)](G)]=H;}}return Object['assign'](j,l);}async[a129K(0x201)](a){const U=a129K;try{if(!a)return;const b=await this[U(0x205)][U(0x214)]();!b&&(Log[U(0x206)]('License\x20error,\x20you\x20may\x20need\x20to\x20re-login\x20or\x20delete\x20your\x20~/.meteor/.maka/global-config.json\x20file\x20to\x20regenerate\x20a\x20free\x20license.'),process[U(0x1e3)](0x1));const c=!b?.[U(0x1fe)][U(0x21d)]('singleLicense')&&!b?.[U(0x1fe)][U(0x21d)]('domainLicense');if(this[U(0x1d3)](a)){const d=U(0x1f1)+a['name']+'\x22,\x20please\x20upgrade\x20to\x20PRO\x20by\x20becoming\x20a\x20pateron\x20@\x20patreon.com/user?u=110174702,\x20then\x20issue:\x20\x27maka\x20login\x27';if(a[U(0x217)][U(0x1ef)])return;const f=b?.['proCommands'][U(0x21d)](a[U(0x1d6)])||b?.[U(0x20b)][U(0x21d)](a[U(0x1ca)]||'')||this[U(0x217)]['isPro'];if(f&&c)throw d;}else{if(this['isGenerator'](a)){const g=b?.[U(0x1d9)][U(0x21d)](a[U(0x1d6)])||b?.[U(0x1d9)][U(0x21d)](a['parent']||'');if(g&&c)throw U(0x1ed)+a['name']+'\x22,\x20please\x20upgrade\x20to\x20PRO\x20by\x20becoming\x20a\x20pateron\x20@\x20patreon.com/user?u=110174702,\x20then\x20issue:\x20\x27maka\x20login\x27';}}}catch(h){Log[U(0x206)](h),process[U(0x1e3)](0x1);}}['isCommand'](a){return'options'in a;}[a129K(0x20f)](a){return!('options'in a);}[a129K(0x1e4)](){const V=a129K;return this[V(0x217)][V(0x1e4)]||this[V(0x217)][V(0x211)]||'No\x20description\x20provided.';}[a129K(0x211)](){const W=a129K;return this['options'][W(0x211)]||W(0x215);}[a129K(0x1e0)](){const X=a129K;return this[X(0x217)]['usage']||'No\x20usage\x20provided.';}[a129K(0x20a)](){const Y=a129K;return this['options'][Y(0x20a)]||[];}[a129K(0x21b)](){const Z=a129K;return this['options'][Z(0x21b)]||Z(0x219);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a130h=a130d;function a130d(a,b){const c=a130c();return a130d=function(d,e){d=d-0x16c;let f=c[d];return f;},a130d(a,b);}(function(a,b){const f=a130d,c=a();while(!![]){try{const d=-parseInt(f(0x175))/0x1*(parseInt(f(0x17d))/0x2)+-parseInt(f(0x177))/0x3+-parseInt(f(0x17c))/0x4*(parseInt(f(0x16d))/0x5)+-parseInt(f(0x16e))/0x6+-parseInt(f(0x17a))/0x7+-parseInt(f(0x178))/0x8+parseInt(f(0x17e))/0x9;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a130c,0x978a4));function a130c(){const k=['101etbMME','password','11106PhVprQ','4830136HmOtoe','ask','3686424DwGSBy','toString','36yWayxW','2006tPmSWa','27425592jtuYau','(((.+)+)+)+$','595760ZPidoG','712848yCNCTS','prompt','options','input','answer','search','confirm'];a130c=function(){return k;};return a130c();}const a130b=(function(){let a=!![];return function(b,c){const d=a?function(){if(c){const e=c['apply'](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a130a=a130b(this,function(){const g=a130d;return a130a[g(0x17b)]()[g(0x173)](g(0x16c))[g(0x17b)]()['constructor'](a130a)[g(0x173)]('(((.+)+)+)+$');});a130a();import a130e from'inquirer';export class Actions{static async[a130h(0x179)](a,b){const i=a130h,{answer:c}=await a130e[i(0x16f)]({'type':b?i(0x176):i(0x171),'name':i(0x172),'message':a});return c;}static async['confirm'](a,b=![]){const j=a130h,{answer:c}=await a130e['prompt']({'type':j(0x174),'name':j(0x172),'message':a,'default':b});return c;}static async[a130h(0x170)](a){const b=await a130e['prompt'](a);return b;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a131r=a131d;(function(a,b){const p=a131d,c=a();while(!![]){try{const d=-parseInt(p(0x19d))/0x1+-parseInt(p(0x1e5))/0x2+parseInt(p(0x1eb))/0x3+-parseInt(p(0x1b5))/0x4*(parseInt(p(0x1d0))/0x5)+-parseInt(p(0x1d8))/0x6+-parseInt(p(0x1fa))/0x7+parseInt(p(0x1d4))/0x8;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a131c,0x862e5));function a131c(){const U=['deleteSecurityGroup','6913354rqTfeP','getSecurityGroups','maka-cli','Port\x20','readFileSync','Value','HostedZones','warn','file://','tag:created-by','length','fsi','ec2rebootInstance','VpcId','ignore','Instance\x20rebooted!','env','subnet','Instances','You\x20will\x20need\x20to\x20update\x20the\x20ssh.json\x20file\x20yourself.','Please\x20choose\x20a\x20VPC:\x20[0]\x20','chmod\x20400\x20','No\x20instances\x20found','KeyMaterial','pem','From\x20AWS:','Successfully\x20linked\x20EC2\x20instance\x20','Pem\x20key\x20saved\x20to\x20','createKeyPairEC2Key','instanceId','createKeyPair','instance','exit','utf8','\x20PRIV_IP:\x20','now','Availability','cidr','status','Name','join','KeyName','721346eXuKcg','split','tags','(((.+)+)+)+$','error','search','key','There\x20was\x20an\x20error\x20registering\x20the\x20domain\x20name','You\x20have\x20no\x20key-pairs,\x20please\x20create\x20one.\x20(maka\x20aws\x20create-key-pair\x20--env).','\x20VPCID:\x20','type','success','statusCode','Created:\x20','send','Would\x20you\x20like\x20to\x20update\x20the\x20ssh.json\x20config\x20file?','AVAILABLE','imageId','CidrBlock','privateIp','ec2terminateInstance','tcp','confirm','UserData','32000OyhQTv','linkEC2ToRoute53','Invalid\x20choice','ssh.json','\x20STATUS:\x20','\x27\x20has\x20been\x20registered\x20successfully.','ID:\x20','constructor','deleteKeyPair','environment','[?]\x20Please\x20choose\x20an\x20instance\x20ID:\x20','getAppConfigPath','ask','GroupName','reason','\x20Status\x20Code:\x20','publicIp','notice','config','toString','pop','\x20Error\x20Rason:\x20','push','route53CreateHostedZone','changeResourceRecordSets','Error\x20creating\x20hosted\x20zone','forEach','580oPAvLw','Error\x20generating\x20key\x20pair','maxCount','RegistrationPrice','34578192FxiPWx','_keys','GroupId','Hosted\x20zone\x20created\x20successfully!','5077974FUNoXi','Error\x20fetching\x20domain\x20pricing:','getMakaProjectConfig','httpStatusCode','UPSERT','Could\x20not\x20find\x20hosted\x20zone','ecrCreateRepository','stringify','\x20NAME:\x20','Prices','\x20ENV:\x20','/dev/sdh','sgId','1922120XfBobu','registerDomain','userData','description','ec2createSG','find','2015064zGsvsQ','ingressRule','name','isFile','parse','Key\x20Name:\x20[','running','ec2describeInstances','0.0.0.0/0','Description:','log','AWS\x20was\x20not\x20able\x20to\x20validate\x20the\x20provided\x20access\x20credentials','\x20INSTANCE_ID:\x20','.pem.txt'];a131c=function(){return U;};return a131c();}const a131b=(function(){let a=!![];return function(b,c){const d=a?function(){if(c){const e=c['apply'](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a131a=a131b(this,function(){const q=a131d;return a131a[q(0x1c8)]()[q(0x1a2)](q(0x1a0))[q(0x1c8)]()[q(0x1bc)](a131a)['search'](q(0x1a0));});a131a();import a131e from'fs';function a131d(a,b){const c=a131c();return a131d=function(d,e){d=d-0x19c;let f=c[d];return f;},a131d(a,b);}import a131f from'path';import{execSync}from'child_process';import{Actions}from'../actions/actions.class.js';import{Log}from'../log/log.class.js';import{FSI}from'../fsi/fsi.class.js';import{EC2Client,DescribeInstancesCommand,RunInstancesCommand,TerminateInstancesCommand,CreateKeyPairCommand,AuthorizeSecurityGroupIngressCommand,CreateSecurityGroupCommand,RebootInstancesCommand,DescribeVpcsCommand,DescribeKeyPairsCommand,DeleteKeyPairCommand,DescribeSecurityGroupsCommand,DeleteSecurityGroupCommand}from'@aws-sdk/client-ec2';import{ECRClient,CreateRepositoryCommand}from'@aws-sdk/client-ecr';import{Route53,Route53Client,CreateHostedZoneCommand}from'@aws-sdk/client-route-53';import{Route53Domains,CheckDomainAvailabilityCommand,RegisterDomainCommand,ListPricesCommand}from'@aws-sdk/client-route-53-domains';const client=new EC2Client({}),ecrClient=new ECRClient({}),route53Client=new Route53Client({}),route53=new Route53({}),route53Domains=new Route53Domains({});export class AWS{[a131r(0x205)];constructor(){const s=a131r;this[s(0x205)]=new FSI();}async[a131r(0x1de)](a){const t=a131r;try{const b={'repositoryName':a[t(0x1ed)]},c=new CreateRepositoryCommand(b),d=await ecrClient['send'](c);return d;}catch(f){Log['error'](f);}}async[a131r(0x1cc)](a){const u=a131r;try{const b={'CallerReference':''+Date[u(0x21d)](),'Name':a},c=new CreateHostedZoneCommand(b);await route53Client[u(0x1ab)](c),Log[u(0x1a8)](u(0x1d7));}catch(d){Log['error'](u(0x1ce)),console[u(0x1a1)](d);}}async[a131r(0x1e6)](a,b,c,d){const v=a131r;try{const e={'DomainName':b,'DurationInYears':c,'AutoRenew':d,'AdminContact':a,'RegistrantContact':a,'TechContact':a},f=new RegisterDomainCommand(e);await route53['send'](f),Log[v(0x1c6)]('The\x20domain\x20\x27'+b+v(0x1ba));}catch(g){Log[v(0x1a1)](v(0x1a4)),Log[v(0x201)](v(0x213)),console[v(0x1a1)](v(0x1c4)+g['$response'][v(0x1a9)]),console[v(0x1a1)](v(0x1ca)+g['$response'][v(0x1c3)]);}}async['checkDomainAvailability'](a){const w=a131r,b={'DomainName':a},c=new CheckDomainAvailabilityCommand(b),d=await route53Domains[w(0x1ab)](c),e=d[w(0x21e)]===w(0x1ad);if(e){const f=a[w(0x19e)]('.')[w(0x1c9)](),g={'MaxItems':0x1,'Tld':f};try{const h=new ListPricesCommand(g),i=await route53Domains[w(0x1ab)](h);if(i&&i[w(0x1e1)]&&i[w(0x1e1)][0x0]?.[w(0x1d3)]){const j=i[w(0x1e1)][0x0][w(0x1d3)];return{'available':e,'cost':j};}}catch(k){console[w(0x1a1)](w(0x1d9),k);}}return{'available':e};}async[a131r(0x1b6)](a,b,c){const x=a131r;try{const d=await route53['listHostedZonesByName']({'DNSName':c});if(!d?.['HostedZones'])throw Log['error'](x(0x1dd));const e=d?.[x(0x200)][0x0]['Id'],f={'ChangeBatch':{'Changes':[{'Action':x(0x1dc),'ResourceRecordSet':{'Name':c,'Type':'A','TTL':0x12c,'ResourceRecords':[{'Value':b}]}}]},'HostedZoneId':e};await route53[x(0x1cd)](f),Log[x(0x1c6)](x(0x214)+a+'\x20to\x20'+c);}catch(g){console[x(0x1a1)]('Error\x20linking\x20EC2\x20to\x20Route\x2053:',g);}}async['ec2create'](a){const y=a131r;try{const b={'BlockDeviceMappings':[{'DeviceName':y(0x1e3),'Ebs':{'VolumeSize':0x64}}],'ImageId':a[y(0x1ae)],'InstanceType':a[y(0x1a7)],'KeyName':a[y(0x1a3)],'MaxCount':a[y(0x1d2)],'MinCount':a['minCount'],'SecurityGroupIds':a['sgIds']['split'](','),'SubnetId':a[y(0x20b)],'TagSpecifications':[{'ResourceType':y(0x219),'Tags':a[y(0x19f)]}]};a[y(0x1e7)]&&(b[y(0x1b4)]=y(0x202)+a[y(0x1e7)]);const c=new RunInstancesCommand(b),d=await client[y(0x1ab)](c);return d;}catch(f){Log[y(0x1a1)](f);}}async[a131r(0x1b1)](a){const z=a131r;try{const b={'InstanceIds':[a[z(0x217)]]},c=new TerminateInstancesCommand(b),d=await client[z(0x1ab)](c);return d;}catch(f){return Log[z(0x1a1)](f),{};}}async['createKeyPairEC2Key']({keyName:a,env:b}){const A=a131r,c=this[A(0x205)][A(0x1c0)](b),d=a131f[A(0x222)](c,A(0x1d5),a+A(0x1f8));try{const f={'KeyName':a},g=new CreateKeyPairCommand(f),h=await client[A(0x1ab)](g),i=h[A(0x211)];if(i){await this[A(0x205)]['createFile']({'filePath':d,'data':i}),execSync(A(0x20f)+d,{'stdio':A(0x208)});const j=this[A(0x205)][A(0x1ee)](d);if(j)return Log[A(0x1a8)](A(0x215)+d),{'keyName':a,'filePath':d};else throw new Error('Error\x20saving\x20pem\x20file,\x20aborting');}else throw new Error(A(0x1d1));}catch(k){Log[A(0x1a1)](k),process[A(0x21a)](0x1);}}async[a131r(0x1ec)]({port:a,groupId:b}){const B=a131r,c={'GroupId':b,'IpPermissions':[{'FromPort':a,'IpProtocol':B(0x1b2),'IpRanges':[{'CidrIp':B(0x1f3),'Description':''}],'ToPort':a}]},d=new AuthorizeSecurityGroupIngressCommand(c);return Log[B(0x1c6)](B(0x1fd)+a+'\x20opened!'),await client[B(0x1ab)](d);}async[a131r(0x1e9)](a){const C=a131r;try{a['description']===''&&(a[C(0x1e8)]=await Actions[C(0x1c1)](C(0x1f4))||'Web\x20App');const b={'Description':a['description'],'GroupName':a[C(0x1ed)],'VpcId':a['vpcId']},c=new CreateSecurityGroupCommand(b),d=await client['send'](c),{GroupId:f}=d;if(!d)throw new Error(C(0x1f6));f&&a['sgPorts'][C(0x1cf)](g=>{const D=C;this[D(0x1ec)]({'port':parseInt(g),'groupId':f});}),Log[C(0x1a8)](C(0x1aa)+f+'\x20NAME:\x20'+a[C(0x1ed)]);}catch(g){return Log[C(0x1a1)](g),![];}return!![];}async['ec2describeKeys'](a){const E=a131r,b=[];try{const c={},d=new DescribeKeyPairsCommand(c),f=await client[E(0x1ab)](d);if(!f)throw E(0x1f6);const {KeyPairs:g}=f;g?(g?.[E(0x1cf)]((h,i)=>{const F=E;h[F(0x19c)]&&b[F(0x1cb)]({'id':i,'name':h['KeyName']});}),b[E(0x204)]>0x0&&b[E(0x1cf)](h=>{const G=E;h[G(0x1ed)]===a?.['suggestion']?Log[G(0x1a8)](G(0x1bb)+h['id']+G(0x1e0)+h[G(0x1ed)]):Log[G(0x1c6)](G(0x1bb)+h['id']+G(0x1e0)+h[G(0x1ed)]);})):Log['error'](E(0x1a5));}catch(h){Log[E(0x1a1)](h);}return b;}async[a131r(0x1bd)](a){try{const b={'KeyName':a},c=new DeleteKeyPairCommand(b);await client['send'](c);}catch(d){Log['error'](d),process['exit'](0x1);}}async[a131r(0x1f2)](){const H=a131r,a=[];try{const b={'Filters':[{'Name':H(0x203),'Values':[H(0x1fc)]}]},c=new DescribeInstancesCommand(b),d=await client[H(0x1ab)](c);d['Reservations']?.[H(0x1cf)]((f,g)=>{const I=H;if(f?.[I(0x20c)]){const {InstanceId:h,PublicIpAddress:i,PrivateIpAddress:j,State:k,KeyName:l,Tags:m}=f[I(0x20c)][0x0],n=m?.[I(0x1ea)](({Key:o})=>o===I(0x1be));a['push']({'id':g,'instanceId':h,'privateIp':j,'publicIp':i,'status':k?.[I(0x221)],'name':l,'env':n?.[I(0x1ff)]});}}),a[H(0x204)]>0x0?a[H(0x1cf)](f=>{const J=H,g=J(0x1bb)+f['id']+J(0x1e0)+f[J(0x1ed)]+J(0x1e2)+f[J(0x20a)]+J(0x1b9)+f[J(0x220)]+J(0x1f7)+f[J(0x217)]+'\x20PUB_IP:\x20'+f[J(0x1c5)]+J(0x21c)+f[J(0x1b0)];if(f['status']==='terminated')Log['error'](g);else f['status']===J(0x1f1)?Log[J(0x1a8)](g):Log[J(0x1c6)](g);}):Log[H(0x1a1)]('You\x20have\x20no\x20instances\x20created\x20by\x20maka-cli.\x20\x20Please\x20reivew\x20your\x20AWS\x20console\x20manually!!!');}catch(f){Log[H(0x1a1)](f);}return a;}async[a131r(0x206)](a){const K=a131r;try{const b={'InstanceIds':[a[K(0x217)]]},c=new RebootInstancesCommand(b),d=await client[K(0x1ab)](c);return d['$metadata'][K(0x1db)]===0xc8&&Log[K(0x1a8)](K(0x209)),d;}catch(f){Log[K(0x1a1)](f);}}async['chooseVPC'](){const L=a131r;let a='';Log[L(0x1c6)]('**\x20Available\x20\x20VPCs\x20**');const b=new DescribeVpcsCommand({}),c=await client['send'](b),{Vpcs:d}=c,e=[];d&&d[L(0x1cf)]((g,h)=>{const M=L;g[M(0x207)]&&g[M(0x1af)]&&e[M(0x1cb)]({'id':h,'vpcId':g[M(0x207)],'cidr':g['CidrBlock']});});e[L(0x1cf)](function(g){const N=L;console[N(0x1f5)]('ID:\x20'+g['id']+N(0x1a6)+g['vpcId']+'\x20CIDR:\x20'+g[N(0x21f)]);});const f=await Actions[L(0x1c1)](L(0x20e))||0x0;e[L(0x1cf)](function(g){const O=L;g['id']==f&&(a=g['vpcId'],Log[O(0x1a8)]('[+]\x20Setting\x20VPC\x20ID\x20to:\x20'+a+'\x0a'));});if(a==='')return Log[L(0x1a1)]('That\x20was\x20not\x20an\x20id\x20in\x20the\x20list.'),'';return a;}async['chooseInstance'](){const P=a131r,a=await this[P(0x1f2)]();if(a[P(0x204)]===0x0)return Log[P(0x1a1)](P(0x210)),null;const b=await Actions['ask'](P(0x1bf));!b&&(Log[P(0x1a1)](P(0x1b7)),process['exit'](0x0));const c=a[P(0x1ea)](({id:d})=>{return d==parseInt(b);})||null;return c;}async[a131r(0x218)]({env:a}){const Q=a131r,b=this[Q(0x205)][Q(0x1da)](),{appName:c}=b,d=c+'-'+a,f=await Actions[Q(0x1c1)](Q(0x1f0)+d+']\x20')||d,{filePath:g}=await this[Q(0x216)]({'keyName':f,'env':a});try{const h=await Actions[Q(0x1b3)](Q(0x1ac),!![]);if(h)try{const i=a131e[Q(0x1fe)](a131f[Q(0x222)](Q(0x1c7),a,Q(0x1b8)),Q(0x21b)),j=JSON[Q(0x1ef)](i);j[Q(0x212)]=a131f[Q(0x222)]('_keys',f+'.pem.txt'),a131e['writeFileSync'](a131f['join'](Q(0x1c7),a,Q(0x1b8)),JSON[Q(0x1df)](j,null,0x2));}catch(k){Log[Q(0x1a1)](k),Log['error'](Q(0x20d));}}catch(l){Log[Q(0x1a1)](l),process[Q(0x21a)](0x1);}return{'keyName':f,'filePath':g};}async[a131r(0x1fb)](a){const R=a131r,b=[],c={},d=new DescribeSecurityGroupsCommand(c),e=await client[R(0x1ab)](d),{SecurityGroups:f}=e;f&&f['forEach'](function(i,j){const S=R;i[S(0x1c2)]&&i['GroupId']&&b[S(0x1cb)]({'id':j,'name':i[S(0x1c2)],'sgId':i[S(0x1d6)]});});let g='',h=0x0;return b['forEach'](function(i){const T=R;i[T(0x1ed)]===a&&(g=i[T(0x1e4)],h=i['id']);}),{'sgList':b,'createdSgId':g,'listIndexId':h};}async[a131r(0x1f9)](a){try{const b={'GroupId':a},c=new DeleteSecurityGroupCommand(b);await client['send'](c);}catch(d){Log['error'](d),process['exit'](0x1);}}}
|
|
1
|
+
const a131s=a131d;(function(a,b){const p=a131d,c=a();while(!![]){try{const d=-parseInt(p(0x158))/0x1+parseInt(p(0x12a))/0x2+parseInt(p(0x178))/0x3*(-parseInt(p(0x17c))/0x4)+-parseInt(p(0x18e))/0x5*(parseInt(p(0x150))/0x6)+parseInt(p(0x15b))/0x7+parseInt(p(0x129))/0x8+-parseInt(p(0x17e))/0x9;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a131c,0xa2b2a));const a131b=(function(){let a=!![];return function(b,c){const d=a?function(){const q=a131d;if(c){const e=c[q(0x156)](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a131a=a131b(this,function(){const r=a131d;return a131a[r(0x164)]()['search'](r(0x12b))[r(0x164)]()[r(0x13c)](a131a)['search'](r(0x12b));});a131a();import a131e from'fs';import a131f from'path';import{execSync}from'child_process';import{Actions}from'../actions/actions.class.js';import{Log}from'../log/log.class.js';function a131d(a,b){const c=a131c();return a131d=function(d,e){d=d-0x11b;let f=c[d];return f;},a131d(a,b);}import{FSI}from'../fsi/fsi.class.js';import{EC2Client,DescribeInstancesCommand,RunInstancesCommand,TerminateInstancesCommand,CreateKeyPairCommand,AuthorizeSecurityGroupIngressCommand,CreateSecurityGroupCommand,RebootInstancesCommand,DescribeVpcsCommand,DescribeKeyPairsCommand,DeleteKeyPairCommand,DescribeSecurityGroupsCommand,DeleteSecurityGroupCommand}from'@aws-sdk/client-ec2';import{ECRClient,CreateRepositoryCommand}from'@aws-sdk/client-ecr';function a131c(){const X=['\x20CIDR:\x20','env','\x20to\x20','435cIVfsN','instanceId','sgIds','AVAILABLE','HostedZones','\x20PRIV_IP:\x20','statusCode','push','getMakaProjectConfig','suggestion','exit','ec2terminateInstance','/dev/sdh','UserData','CidrBlock','tags','status','listHostedZonesByName','writeFileSync','userData','maxCount','length','KeyMaterial','[+]\x20Setting\x20VPC\x20ID\x20to:\x20','publicIp','registerDomain','getAppConfigPath','Prices','\x20VPCID:\x20','config','description','linkEC2ToRoute53','tcp','4617392BWJevI','1752194AByIJq','(((.+)+)+)+$','createFile','UPSERT','ssh.json','send','0.0.0.0/0','ec2describeInstances','From\x20AWS:','sgId','running','Could\x20not\x20find\x20hosted\x20zone','That\x20was\x20not\x20an\x20id\x20in\x20the\x20list.','sgPorts','Pem\x20key\x20saved\x20to\x20','Hosted\x20zone\x20created\x20successfully!','\x20Status\x20Code:\x20','split','constructor','imageId','ignore','Successfully\x20linked\x20EC2\x20instance\x20','find','Key\x20Name:\x20[','fsi','Error\x20linking\x20EC2\x20to\x20Route\x2053:','Instances','stringify','tag:created-by','\x20ENV:\x20','ask','Error\x20saving\x20pem\x20file,\x20aborting','GroupName','Description:','environment','reason','type','VpcId','15546DQjUjx','There\x20was\x20an\x20error\x20registering\x20the\x20domain\x20name','Web\x20App','You\x20have\x20no\x20key-pairs,\x20please\x20create\x20one.\x20(maka\x20aws\x20create-key-pair\x20--env).','warn','httpStatusCode','apply','subnet','264727SkEfza','error','Error\x20generating\x20key\x20pair','6676453UJpDCy','Port\x20','The\x20domain\x20\x27','ingressRule','\x20Error\x20Rason:\x20','_keys','Instance\x20rebooted!','chooseInstance','\x20STATUS:\x20','toString','\x20NAME:\x20','\x20PUB_IP:\x20','forEach','vpcId','ID:\x20','RegistrationPrice','join','terminated','createKeyPairEC2Key','createKeyPair','Availability','name','**\x20Available\x20\x20VPCs\x20**','notice','getSecurityGroups','pop','success','Error\x20creating\x20hosted\x20zone','parse','191019chSdAd','minCount','log','.pem.txt','20AqGJxQ','$response','8389179beHWFw','chooseVPC','$metadata','GroupId','deleteKeyPair','KeyName','pem','AWS\x20was\x20not\x20able\x20to\x20validate\x20the\x20provided\x20access\x20credentials','checkDomainAvailability','ec2describeKeys','isFile','You\x20have\x20no\x20instances\x20created\x20by\x20maka-cli.\x20\x20Please\x20reivew\x20your\x20AWS\x20console\x20manually!!!','ec2rebootInstance'];a131c=function(){return X;};return a131c();}import{Route53,Route53Client,CreateHostedZoneCommand}from'@aws-sdk/client-route-53';import{Route53Domains,CheckDomainAvailabilityCommand,RegisterDomainCommand,ListPricesCommand}from'@aws-sdk/client-route-53-domains';const client=new EC2Client({}),ecrClient=new ECRClient({}),route53Client=new Route53Client({}),route53=new Route53({}),route53Domains=new Route53Domains({});export class AWS{[a131s(0x142)];constructor(){const t=a131s;this[t(0x142)]=new FSI();}async['ecrCreateRepository'](a){const u=a131s;try{const b={'repositoryName':a[u(0x170)]},c=new CreateRepositoryCommand(b),d=await ecrClient[u(0x12f)](c);return d;}catch(f){Log['error'](f);}}async['route53CreateHostedZone'](a){const v=a131s;try{const b={'CallerReference':''+Date['now'](),'Name':a},c=new CreateHostedZoneCommand(b);await route53Client['send'](c),Log[v(0x175)](v(0x139));}catch(d){Log[v(0x159)](v(0x176)),console['error'](d);}}async[a131s(0x121)](a,b,c,d){const w=a131s;try{const e={'DomainName':b,'DurationInYears':c,'AutoRenew':d,'AdminContact':a,'RegistrantContact':a,'TechContact':a},f=new RegisterDomainCommand(e);await route53[w(0x12f)](f),Log['notice'](w(0x15d)+b+'\x27\x20has\x20been\x20registered\x20successfully.');}catch(g){Log['error'](w(0x151)),Log[w(0x154)](w(0x132)),console[w(0x159)](w(0x13a)+g[w(0x17d)][w(0x194)]),console[w(0x159)](w(0x15f)+g[w(0x17d)][w(0x14d)]);}}async[a131s(0x186)](a){const x=a131s,b={'DomainName':a},c=new CheckDomainAvailabilityCommand(b),d=await route53Domains['send'](c),e=d[x(0x16f)]===x(0x191);if(e){const f=a[x(0x13b)]('.')[x(0x174)](),g={'MaxItems':0x1,'Tld':f};try{const h=new ListPricesCommand(g),i=await route53Domains['send'](h);if(i&&i[x(0x123)]&&i['Prices'][0x0]?.[x(0x16a)]){const j=i[x(0x123)][0x0][x(0x16a)];return{'available':e,'cost':j};}}catch(k){console['error']('Error\x20fetching\x20domain\x20pricing:',k);}}return{'available':e};}async[a131s(0x127)](a,b,c){const y=a131s;try{const d=await route53[y(0x19f)]({'DNSName':c});if(!d?.[y(0x192)])throw Log[y(0x159)](y(0x135));const e=d?.[y(0x192)][0x0]['Id'],f={'ChangeBatch':{'Changes':[{'Action':y(0x12d),'ResourceRecordSet':{'Name':c,'Type':'A','TTL':0x12c,'ResourceRecords':[{'Value':b}]}}]},'HostedZoneId':e};await route53['changeResourceRecordSets'](f),Log[y(0x172)](y(0x13f)+a+y(0x18d)+c);}catch(g){console[y(0x159)](y(0x143),g);}}async['ec2create'](a){const z=a131s;try{const b={'BlockDeviceMappings':[{'DeviceName':z(0x19a),'Ebs':{'VolumeSize':0x64}}],'ImageId':a[z(0x13d)],'InstanceType':a[z(0x14e)],'KeyName':a['key'],'MaxCount':a[z(0x11c)],'MinCount':a[z(0x179)],'SecurityGroupIds':a[z(0x190)]['split'](','),'SubnetId':a[z(0x157)],'TagSpecifications':[{'ResourceType':'instance','Tags':a[z(0x19d)]}]};a[z(0x11b)]&&(b[z(0x19b)]='file://'+a['userData']);const c=new RunInstancesCommand(b),d=await client['send'](c);return d;}catch(f){Log[z(0x159)](f);}}async[a131s(0x199)](a){const A=a131s;try{const b={'InstanceIds':[a[A(0x18f)]]},c=new TerminateInstancesCommand(b),d=await client['send'](c);return d;}catch(f){return Log[A(0x159)](f),{};}}async['createKeyPairEC2Key']({keyName:a,env:b}){const B=a131s,c=this[B(0x142)][B(0x122)](b),d=a131f[B(0x16b)](c,'_keys',a+B(0x17b));try{const f={'KeyName':a},g=new CreateKeyPairCommand(f),h=await client[B(0x12f)](g),i=h[B(0x11e)];if(i){await this[B(0x142)][B(0x12c)]({'filePath':d,'data':i}),execSync('chmod\x20400\x20'+d,{'stdio':B(0x13e)});const j=this['fsi'][B(0x188)](d);if(j)return Log[B(0x175)](B(0x138)+d),{'keyName':a,'filePath':d};else throw new Error(B(0x149));}else throw new Error(B(0x15a));}catch(k){Log[B(0x159)](k),process['exit'](0x1);}}async['ingressRule']({port:a,groupId:b}){const C=a131s,c={'GroupId':b,'IpPermissions':[{'FromPort':a,'IpProtocol':C(0x128),'IpRanges':[{'CidrIp':C(0x130),'Description':''}],'ToPort':a}]},d=new AuthorizeSecurityGroupIngressCommand(c);return Log['notice'](C(0x15c)+a+'\x20opened!'),await client['send'](d);}async['ec2createSG'](a){const D=a131s;try{a[D(0x126)]===''&&(a[D(0x126)]=await Actions[D(0x148)](D(0x14b))||D(0x152));const b={'Description':a['description'],'GroupName':a[D(0x170)],'VpcId':a[D(0x168)]},c=new CreateSecurityGroupCommand(b),d=await client[D(0x12f)](c),{GroupId:f}=d;if(!d)throw new Error(D(0x185));f&&a[D(0x137)]['forEach'](g=>{const E=D;this[E(0x15e)]({'port':parseInt(g),'groupId':f});}),Log[D(0x175)]('Created:\x20'+f+D(0x165)+a['name']);}catch(g){return Log[D(0x159)](g),![];}return!![];}async[a131s(0x187)](a){const F=a131s,b=[];try{const c={},d=new DescribeKeyPairsCommand(c),f=await client[F(0x12f)](d);if(!f)throw F(0x185);const {KeyPairs:g}=f;g?(g?.['forEach']((h,i)=>{const G=F;h[G(0x183)]&&b[G(0x195)]({'id':i,'name':h['KeyName']});}),b[F(0x11d)]>0x0&&b[F(0x167)](h=>{const H=F;h['name']===a?.[H(0x197)]?Log['success'](H(0x169)+h['id']+'\x20NAME:\x20'+h[H(0x170)]):Log[H(0x172)](H(0x169)+h['id']+H(0x165)+h[H(0x170)]);})):Log[F(0x159)](F(0x153));}catch(h){Log['error'](h);}return b;}async[a131s(0x182)](a){const I=a131s;try{const b={'KeyName':a},c=new DeleteKeyPairCommand(b);await client[I(0x12f)](c);}catch(d){Log[I(0x159)](d),process[I(0x198)](0x1);}}async[a131s(0x131)](){const J=a131s,a=[];try{const b={'Filters':[{'Name':J(0x146),'Values':['maka-cli']}]},c=new DescribeInstancesCommand(b),d=await client[J(0x12f)](c);d['Reservations']?.[J(0x167)]((f,g)=>{const K=J;if(f?.[K(0x144)]){const {InstanceId:h,PublicIpAddress:i,PrivateIpAddress:j,State:k,KeyName:l,Tags:m}=f[K(0x144)][0x0],n=m?.['find'](({Key:o})=>o===K(0x14c));a['push']({'id':g,'instanceId':h,'privateIp':j,'publicIp':i,'status':k?.['Name'],'name':l,'env':n?.['Value']});}}),a[J(0x11d)]>0x0?a[J(0x167)](f=>{const L=J,g=L(0x169)+f['id']+L(0x165)+f[L(0x170)]+L(0x147)+f[L(0x18c)]+L(0x163)+f['status']+'\x20INSTANCE_ID:\x20'+f['instanceId']+L(0x166)+f[L(0x120)]+L(0x193)+f['privateIp'];if(f[L(0x19e)]===L(0x16c))Log[L(0x159)](g);else f[L(0x19e)]===L(0x134)?Log[L(0x175)](g):Log[L(0x172)](g);}):Log[J(0x159)](J(0x189));}catch(f){Log['error'](f);}return a;}async[a131s(0x18a)](a){const M=a131s;try{const b={'InstanceIds':[a[M(0x18f)]]},c=new RebootInstancesCommand(b),d=await client[M(0x12f)](c);return d[M(0x180)][M(0x155)]===0xc8&&Log['success'](M(0x161)),d;}catch(f){Log[M(0x159)](f);}}async[a131s(0x17f)](){const N=a131s;let a='';Log['notice'](N(0x171));const b=new DescribeVpcsCommand({}),c=await client[N(0x12f)](b),{Vpcs:d}=c,e=[];d&&d[N(0x167)]((g,h)=>{const O=N;g[O(0x14f)]&&g[O(0x19c)]&&e[O(0x195)]({'id':h,'vpcId':g[O(0x14f)],'cidr':g[O(0x19c)]});});e[N(0x167)](function(g){const P=N;console[P(0x17a)](P(0x169)+g['id']+P(0x124)+g[P(0x168)]+P(0x18b)+g['cidr']);});const f=await Actions[N(0x148)]('Please\x20choose\x20a\x20VPC:\x20[0]\x20')||0x0;e['forEach'](function(g){const Q=N;g['id']==f&&(a=g[Q(0x168)],Log[Q(0x175)](Q(0x11f)+a+'\x0a'));});if(a==='')return Log[N(0x159)](N(0x136)),'';return a;}async[a131s(0x162)](){const R=a131s,a=await this['ec2describeInstances']();if(a[R(0x11d)]===0x0)return Log[R(0x159)]('No\x20instances\x20found'),null;const b=await Actions['ask']('[?]\x20Please\x20choose\x20an\x20instance\x20ID:\x20');!b&&(Log[R(0x159)]('Invalid\x20choice'),process['exit'](0x0));const c=a[R(0x140)](({id:d})=>{return d==parseInt(b);})||null;return c;}async[a131s(0x16e)]({env:a}){const S=a131s,b=this[S(0x142)][S(0x196)](),{appName:c}=b,d=c+'-'+a,f=await Actions['ask'](S(0x141)+d+']\x20')||d,{filePath:g}=await this[S(0x16d)]({'keyName':f,'env':a});try{const h=await Actions['confirm']('Would\x20you\x20like\x20to\x20update\x20the\x20ssh.json\x20config\x20file?',!![]);if(h)try{const i=a131e['readFileSync'](a131f[S(0x16b)](S(0x125),a,'ssh.json'),'utf8'),j=JSON[S(0x177)](i);j[S(0x184)]=a131f['join'](S(0x160),f+S(0x17b)),a131e[S(0x1a0)](a131f[S(0x16b)]('config',a,S(0x12e)),JSON[S(0x145)](j,null,0x2));}catch(k){Log[S(0x159)](k),Log[S(0x159)]('You\x20will\x20need\x20to\x20update\x20the\x20ssh.json\x20file\x20yourself.');}}catch(l){Log[S(0x159)](l),process[S(0x198)](0x1);}return{'keyName':f,'filePath':g};}async[a131s(0x173)](a){const T=a131s,b=[],c={},d=new DescribeSecurityGroupsCommand(c),e=await client[T(0x12f)](d),{SecurityGroups:f}=e;f&&f[T(0x167)](function(i,j){const U=T;i[U(0x14a)]&&i[U(0x181)]&&b[U(0x195)]({'id':j,'name':i[U(0x14a)],'sgId':i['GroupId']});});let g='',h=0x0;return b[T(0x167)](function(i){const V=T;i['name']===a&&(g=i[V(0x133)],h=i['id']);}),{'sgList':b,'createdSgId':g,'listIndexId':h};}async['deleteSecurityGroup'](a){const W=a131s;try{const b={'GroupId':a},c=new DeleteSecurityGroupCommand(b);await client[W(0x12f)](c);}catch(d){Log['error'](d),process[W(0x198)](0x1);}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,b){var k=a132d,c=a();while(!![]){try{var d=parseInt(k(
|
|
1
|
+
(function(a,b){var k=a132d,c=a();while(!![]){try{var d=parseInt(k(0xb1))/0x1*(-parseInt(k(0xb0))/0x2)+parseInt(k(0xa7))/0x3*(-parseInt(k(0xa6))/0x4)+-parseInt(k(0xad))/0x5*(-parseInt(k(0xae))/0x6)+-parseInt(k(0xaf))/0x7+-parseInt(k(0xa9))/0x8*(parseInt(k(0xa3))/0x9)+-parseInt(k(0xab))/0xa+parseInt(k(0xaa))/0xb;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a132c,0xc7a24));function a132c(){var n=['651NLmhnL','search','317512WSlKFR','57682559rOpNaZ','11506530GaUgnZ','(((.+)+)+)+$','40855OFkGJo','642TuwfZr','8613276oXhZIe','18GyltRN','7965UQlDTN','279gMnYOw','toString','apply','29812sYnpEp'];a132c=function(){return n;};return a132c();}export var CountryCode;function a132d(a,b){var c=a132c();return a132d=function(d,e){d=d-0xa3;var f=c[d];return f;},a132d(a,b);}(function(c){var d=(function(){var f=!![];return function(g,h){var i=f?function(){var l=a132d;if(h){var j=h[l(0xa5)](g,arguments);return h=null,j;}}:function(){};return f=![],i;};}()),e=d(this,function(){var m=a132d;return e[m(0xa4)]()[m(0xa8)](m(0xac))[m(0xa4)]()['constructor'](e)[m(0xa8)](m(0xac));});e(),c['AC']='AC',c['AD']='AD',c['AE']='AE',c['AF']='AF',c['AG']='AG',c['AI']='AI',c['AL']='AL',c['AM']='AM',c['AN']='AN',c['AO']='AO',c['AQ']='AQ',c['AR']='AR',c['AS']='AS',c['AT']='AT',c['AU']='AU',c['AW']='AW',c['AX']='AX',c['AZ']='AZ',c['BA']='BA',c['BB']='BB',c['BD']='BD',c['BE']='BE',c['BF']='BF',c['BG']='BG',c['BH']='BH',c['BI']='BI',c['BJ']='BJ',c['BL']='BL',c['BM']='BM',c['BN']='BN',c['BO']='BO',c['BQ']='BQ',c['BR']='BR',c['BS']='BS',c['BT']='BT',c['BV']='BV',c['BW']='BW',c['BY']='BY',c['BZ']='BZ',c['CA']='CA',c['CC']='CC',c['CD']='CD',c['CF']='CF',c['CG']='CG',c['CH']='CH',c['CI']='CI',c['CK']='CK',c['CL']='CL',c['CM']='CM',c['CN']='CN',c['CO']='CO',c['CR']='CR',c['CU']='CU',c['CV']='CV',c['CW']='CW',c['CX']='CX',c['CY']='CY',c['CZ']='CZ',c['DE']='DE',c['DJ']='DJ',c['DK']='DK',c['DM']='DM',c['DO']='DO',c['DZ']='DZ',c['EC']='EC',c['EE']='EE',c['EG']='EG',c['EH']='EH',c['ER']='ER',c['ES']='ES',c['ET']='ET',c['FI']='FI',c['FJ']='FJ',c['FK']='FK',c['FM']='FM',c['FO']='FO',c['FR']='FR',c['GA']='GA',c['GB']='GB',c['GD']='GD',c['GE']='GE',c['GF']='GF',c['GG']='GG',c['GH']='GH',c['GI']='GI',c['GL']='GL',c['GM']='GM',c['GN']='GN',c['GP']='GP',c['GQ']='GQ',c['GR']='GR',c['GS']='GS',c['GT']='GT',c['GU']='GU',c['GW']='GW',c['GY']='GY',c['HK']='HK',c['HM']='HM',c['HN']='HN',c['HR']='HR',c['HT']='HT',c['HU']='HU',c['ID']='ID',c['IE']='IE',c['IL']='IL',c['IM']='IM',c['IN']='IN',c['IO']='IO',c['IQ']='IQ',c['IR']='IR',c['IS']='IS',c['IT']='IT',c['JE']='JE',c['JM']='JM',c['JO']='JO',c['JP']='JP',c['KE']='KE',c['KG']='KG',c['KH']='KH',c['KI']='KI',c['KM']='KM',c['KN']='KN',c['KP']='KP',c['KR']='KR',c['KW']='KW',c['KY']='KY',c['KZ']='KZ',c['LA']='LA',c['LB']='LB',c['LC']='LC',c['LI']='LI',c['LK']='LK',c['LR']='LR',c['LS']='LS',c['LT']='LT',c['LU']='LU',c['LV']='LV',c['LY']='LY',c['MA']='MA',c['MC']='MC',c['MD']='MD',c['ME']='ME',c['MF']='MF',c['MG']='MG',c['MH']='MH',c['MK']='MK',c['ML']='ML',c['MM']='MM',c['MN']='MN',c['MO']='MO',c['MP']='MP',c['MQ']='MQ',c['MR']='MR',c['MS']='MS',c['MT']='MT',c['MU']='MU',c['MV']='MV',c['MW']='MW',c['MX']='MX',c['MY']='MY',c['MZ']='MZ',c['NA']='NA',c['NC']='NC',c['NE']='NE',c['NF']='NF',c['NG']='NG',c['NI']='NI',c['NL']='NL',c['NO']='NO',c['NP']='NP',c['NR']='NR',c['NU']='NU',c['NZ']='NZ',c['OM']='OM',c['PA']='PA',c['PE']='PE',c['PF']='PF',c['PG']='PG',c['PH']='PH',c['PK']='PK',c['PL']='PL',c['PM']='PM',c['PN']='PN',c['PR']='PR',c['PS']='PS',c['PT']='PT',c['PW']='PW',c['PY']='PY',c['QA']='QA',c['RE']='RE',c['RO']='RO',c['RS']='RS',c['RU']='RU',c['RW']='RW',c['SA']='SA',c['SB']='SB',c['SC']='SC',c['SD']='SD',c['SE']='SE',c['SG']='SG',c['SH']='SH',c['SI']='SI',c['SJ']='SJ',c['SK']='SK',c['SL']='SL',c['SM']='SM',c['SN']='SN',c['SO']='SO',c['SR']='SR',c['SS']='SS',c['ST']='ST',c['SV']='SV',c['SX']='SX',c['SY']='SY',c['SZ']='SZ',c['TC']='TC',c['TD']='TD',c['TF']='TF',c['TG']='TG',c['TH']='TH',c['TJ']='TJ',c['TK']='TK',c['TL']='TL',c['TM']='TM',c['TN']='TN',c['TO']='TO',c['TP']='TP',c['TR']='TR',c['TT']='TT',c['TV']='TV',c['TW']='TW',c['TZ']='TZ',c['UA']='UA',c['UG']='UG',c['US']='US',c['UY']='UY',c['UZ']='UZ',c['VA']='VA',c['VC']='VC',c['VE']='VE',c['VG']='VG',c['VI']='VI',c['VN']='VN',c['VU']='VU',c['WF']='WF',c['WS']='WS',c['YE']='YE',c['YT']='YT',c['ZA']='ZA',c['ZM']='ZM',c['ZW']='ZW';}(CountryCode||(CountryCode={})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a133m=a133d;(function(a,b){const j=a133d,c=a();while(!![]){try{const d
|
|
1
|
+
const a133m=a133d;function a133c(){const q=['11HfUoxK','2116446ogoVLt','search','8wTtCUk','3BEntvq','apply','tag','error','3932614wGaCpd','--password-stdin','10lsMlwj','pushImage','inherit','667117xaZzKN','toString','.amazonaws.com','.amazonaws.com/','--username','12391884RwLgtE','6361490kwaGKW','AWS','join','.dkr.ecr.','7178634RdZonb','4UhmZpe','(((.+)+)+)+$','6748516HwdxeP','docker\x20'];a133c=function(){return q;};return a133c();}(function(a,b){const j=a133d,c=a();while(!![]){try{const d=-parseInt(j(0x204))/0x1*(-parseInt(j(0x1f3))/0x2)+-parseInt(j(0x1fb))/0x3*(parseInt(j(0x1f5))/0x4)+parseInt(j(0x201))/0x5*(-parseInt(j(0x1f8))/0x6)+-parseInt(j(0x1ff))/0x7+-parseInt(j(0x1fa))/0x8*(-parseInt(j(0x1f2))/0x9)+parseInt(j(0x1ee))/0xa*(parseInt(j(0x1f7))/0xb)+parseInt(j(0x1ed))/0xc;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a133c,0xce9ad));const a133b=(function(){let a=!![];return function(b,c){const d=a?function(){const k=a133d;if(c){const e=c[k(0x1fc)](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a133a=a133b(this,function(){const l=a133d;return a133a['toString']()[l(0x1f9)]('(((.+)+)+)+$')['toString']()['constructor'](a133a)['search'](l(0x1f4));});a133a();import{execSync}from'child_process';function a133d(a,b){const c=a133c();return a133d=function(d,e){d=d-0x1ea;let f=c[d];return f;},a133d(a,b);}import{Log}from'../log/log.class.js';export class Docker{static[a133m(0x1fd)]({imageName:a,awsAccountId:b,region:c,repoName:d}){const n=a133m;try{const f=[n(0x1fd),a,b+'.dkr.ecr.'+c+n(0x1eb)+d],g=n(0x1f6)+f[n(0x1f0)]('\x20'),h=execSync(g,{'stdio':n(0x203)})[n(0x205)]();return h;}catch(i){return Log[n(0x1fe)](i),'';}}static['awsLogin']({awsAccountId:a,region:b}){const o=a133m;try{const c=['login',o(0x1ec),o(0x1ef),o(0x200),a+o(0x1f1)+b+o(0x1ea)],d=o(0x1f6)+c[o(0x1f0)]('\x20'),f=execSync(d,{'stdio':o(0x203)})['toString']();return f;}catch(g){return Log[o(0x1fe)](g),'';}}static[a133m(0x202)]({awsAccountId:a,region:b,repoName:c}){const p=a133m;try{const d=['push',a+p(0x1f1)+b+p(0x1eb)+c],f='docker\x20'+d[p(0x1f0)]('\x20'),g=execSync(f,{'stdio':p(0x203)})['toString']();return g;}catch(h){return Log['error'](h),'';}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(a,b){var f=a134d,c=a();while(!![]){try{var d=-parseInt(f(0x1f1))/0x1*(-parseInt(f(0x1f4))/0x2)+-parseInt(f(0x1f5))/0x3+-parseInt(f(0x1ea))/0x4*(-parseInt(f(0x1eb))/0x5)+parseInt(f(0x1f0))/0x6*(-parseInt(f(0x1f3))/0x7)+-parseInt(f(0x1f7))/0x8*(-parseInt(f(0x1ef))/0x9)+parseInt(f(0x1f2))/0xa+-parseInt(f(0x1ee))/0xb;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a134c,0xa0940));var a134b=(function(){var a=!![];return function(b,c){var d=a?function(){var g=a134d;if(c){var e=c[g(0x1f6)](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a134a=a134b(this,function(){var h=a134d;return a134a[h(0x1ec)]()[h(0x1ed)]('(((.+)+)+)+$')[h(0x1ec)]()[h(0x1f8)](a134a)[h(0x1ed)]('(((.+)+)+)+$');});function a134c(){var i=['1802074PGKSUB','2421789uvBAoS','apply','48WeEovj','constructor','4ivOeNi','488615ClspIc','toString','search','12310914iteqWN','1473993gIjSGM','75612HTEmWR','1UnIEVS','10060070kJFNNT','224pukiQH'];a134c=function(){return i;};return a134c();}function a134d(a,b){var c=a134c();return a134d=function(d,e){d=d-0x1ea;var f=c[d];return f;},a134d(a,b);}a134a();export{};
|