@docker-digital/dockernet-agent 0.0.1
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/LICENSE +21 -0
- package/README.md +120 -0
- package/dist/agent/agent.module.d.ts +2 -0
- package/dist/agent/agent.module.js +47 -0
- package/dist/agent/agent.module.js.map +1 -0
- package/dist/agent/commands/agent.command.d.ts +58 -0
- package/dist/agent/commands/agent.command.js +417 -0
- package/dist/agent/commands/agent.command.js.map +1 -0
- package/dist/agent/services/api.service.d.ts +13 -0
- package/dist/agent/services/api.service.js +116 -0
- package/dist/agent/services/api.service.js.map +1 -0
- package/dist/agent/services/config.service.d.ts +28 -0
- package/dist/agent/services/config.service.js +100 -0
- package/dist/agent/services/config.service.js.map +1 -0
- package/dist/agent/services/docker-event.service.d.ts +44 -0
- package/dist/agent/services/docker-event.service.js +141 -0
- package/dist/agent/services/docker-event.service.js.map +1 -0
- package/dist/agent/services/docker.service.d.ts +16 -0
- package/dist/agent/services/docker.service.js +170 -0
- package/dist/agent/services/docker.service.js.map +1 -0
- package/dist/agent/services/event-websocket-client.service.d.ts +49 -0
- package/dist/agent/services/event-websocket-client.service.js +248 -0
- package/dist/agent/services/event-websocket-client.service.js.map +1 -0
- package/dist/agent/services/event.service.d.ts +27 -0
- package/dist/agent/services/event.service.js +242 -0
- package/dist/agent/services/event.service.js.map +1 -0
- package/dist/agent/services/log.service.d.ts +19 -0
- package/dist/agent/services/log.service.js +176 -0
- package/dist/agent/services/log.service.js.map +1 -0
- package/dist/agent/services/machine.service.d.ts +15 -0
- package/dist/agent/services/machine.service.js +148 -0
- package/dist/agent/services/machine.service.js.map +1 -0
- package/dist/agent/services/profile.service.d.ts +33 -0
- package/dist/agent/services/profile.service.js +438 -0
- package/dist/agent/services/profile.service.js.map +1 -0
- package/dist/agent/services/volume-sync.service.d.ts +9 -0
- package/dist/agent/services/volume-sync.service.js +87 -0
- package/dist/agent/services/volume-sync.service.js.map +1 -0
- package/dist/agent/services/websocket-client.service.d.ts +48 -0
- package/dist/agent/services/websocket-client.service.js +278 -0
- package/dist/agent/services/websocket-client.service.js.map +1 -0
- package/dist/app.module.d.ts +2 -0
- package/dist/app.module.js +31 -0
- package/dist/app.module.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +12 -0
- package/dist/main.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +103 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var WebSocketClientService_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.WebSocketClientService = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const socket_io_client_1 = require("socket.io-client");
|
|
16
|
+
const config_service_1 = require("./config.service");
|
|
17
|
+
let WebSocketClientService = WebSocketClientService_1 = class WebSocketClientService {
|
|
18
|
+
constructor(configService) {
|
|
19
|
+
this.configService = configService;
|
|
20
|
+
this.logger = new common_1.Logger(WebSocketClientService_1.name);
|
|
21
|
+
this.socket = null;
|
|
22
|
+
this.isConnected = false;
|
|
23
|
+
this.reconnectAttempts = 0;
|
|
24
|
+
this.messageQueue = [];
|
|
25
|
+
this.maxReconnectAttempts = 10;
|
|
26
|
+
this.baseReconnectDelay = 1000;
|
|
27
|
+
this.maxReconnectDelay = 30000;
|
|
28
|
+
this.httpFallbackEnabled = true;
|
|
29
|
+
this.connectionPromise = null;
|
|
30
|
+
this.pendingConnectionPromise = null;
|
|
31
|
+
}
|
|
32
|
+
async onModuleInit() {
|
|
33
|
+
}
|
|
34
|
+
async connect() {
|
|
35
|
+
if (this.isConnected && this.socket?.connected) {
|
|
36
|
+
this.logger.debug('WebSocket already connected');
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (this.pendingConnectionPromise) {
|
|
40
|
+
this.logger.debug('Connection attempt already in progress, waiting...');
|
|
41
|
+
return this.pendingConnectionPromise;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const wsUrl = await this.getWebSocketUrl();
|
|
45
|
+
const apiKey = await this.configService.getApiKey();
|
|
46
|
+
this.logger.log(`Connecting to WebSocket server: ${wsUrl}`);
|
|
47
|
+
this.pendingConnectionPromise = new Promise((resolve, reject) => {
|
|
48
|
+
const connectionTimeout = setTimeout(() => {
|
|
49
|
+
if (!this.isConnected && this.connectionPromise) {
|
|
50
|
+
this.logger.warn('WebSocket connection timeout');
|
|
51
|
+
this.connectionPromise = null;
|
|
52
|
+
this.pendingConnectionPromise = null;
|
|
53
|
+
reject(new Error('Connection timeout'));
|
|
54
|
+
}
|
|
55
|
+
}, 10000);
|
|
56
|
+
this.connectionPromise = {
|
|
57
|
+
resolve,
|
|
58
|
+
reject,
|
|
59
|
+
timeout: connectionTimeout,
|
|
60
|
+
};
|
|
61
|
+
if (this.socket) {
|
|
62
|
+
if (this.socket.connected) {
|
|
63
|
+
this.logger.debug('Disconnecting existing socket before reconnecting...');
|
|
64
|
+
this.socket.removeAllListeners();
|
|
65
|
+
this.socket.disconnect();
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.socket.removeAllListeners();
|
|
69
|
+
}
|
|
70
|
+
this.socket = null;
|
|
71
|
+
}
|
|
72
|
+
this.socket = (0, socket_io_client_1.io)(`${wsUrl}/v1/api/agent/ws/agent-status`, {
|
|
73
|
+
auth: {
|
|
74
|
+
api_key: apiKey,
|
|
75
|
+
},
|
|
76
|
+
reconnection: true,
|
|
77
|
+
reconnectionDelay: this.baseReconnectDelay,
|
|
78
|
+
reconnectionDelayMax: this.maxReconnectDelay,
|
|
79
|
+
reconnectionAttempts: this.maxReconnectAttempts,
|
|
80
|
+
timeout: 10000,
|
|
81
|
+
transports: ['websocket', 'polling'],
|
|
82
|
+
path: '/socket.io/',
|
|
83
|
+
});
|
|
84
|
+
this.setupSocketHandlers();
|
|
85
|
+
});
|
|
86
|
+
return this.pendingConnectionPromise;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
this.connectionPromise = null;
|
|
90
|
+
this.pendingConnectionPromise = null;
|
|
91
|
+
this.logger.error(`Failed to connect to WebSocket server: ${error.message}`);
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
setupSocketHandlers() {
|
|
96
|
+
if (!this.socket) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.socket.on('connect', () => {
|
|
100
|
+
this.isConnected = true;
|
|
101
|
+
this.reconnectAttempts = 0;
|
|
102
|
+
this.logger.log(`WebSocket connected (socket ID: ${this.socket?.id})`);
|
|
103
|
+
if (this.connectionPromise) {
|
|
104
|
+
clearTimeout(this.connectionPromise.timeout);
|
|
105
|
+
this.connectionPromise.resolve();
|
|
106
|
+
this.connectionPromise = null;
|
|
107
|
+
this.pendingConnectionPromise = null;
|
|
108
|
+
}
|
|
109
|
+
this.flushMessageQueue();
|
|
110
|
+
});
|
|
111
|
+
this.socket.on('connect_error', (error) => {
|
|
112
|
+
this.logger.error(`WebSocket connection error: ${error.message}`);
|
|
113
|
+
this.isConnected = false;
|
|
114
|
+
if (this.connectionPromise) {
|
|
115
|
+
clearTimeout(this.connectionPromise.timeout);
|
|
116
|
+
this.connectionPromise.reject(new Error(error.message || 'Connection failed'));
|
|
117
|
+
this.connectionPromise = null;
|
|
118
|
+
this.pendingConnectionPromise = null;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
this.socket.on('disconnect', (reason) => {
|
|
122
|
+
if (reason === 'io client disconnect') {
|
|
123
|
+
this.logger.debug(`WebSocket disconnected: ${reason}`);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this.logger.warn(`WebSocket disconnected: ${reason}`);
|
|
127
|
+
}
|
|
128
|
+
this.isConnected = false;
|
|
129
|
+
});
|
|
130
|
+
this.socket.on('error', (error) => {
|
|
131
|
+
this.logger.error(`WebSocket error: ${error.message}`);
|
|
132
|
+
});
|
|
133
|
+
this.socket.on('reconnect_attempt', (attemptNumber) => {
|
|
134
|
+
this.reconnectAttempts = attemptNumber;
|
|
135
|
+
this.logger.debug(`WebSocket reconnection attempt ${attemptNumber}`);
|
|
136
|
+
});
|
|
137
|
+
this.socket.on('reconnect', (attemptNumber) => {
|
|
138
|
+
this.logger.log(`WebSocket reconnected after ${attemptNumber} attempts`);
|
|
139
|
+
});
|
|
140
|
+
this.socket.on('reconnect_failed', () => {
|
|
141
|
+
this.logger.error('WebSocket reconnection failed');
|
|
142
|
+
this.isConnected = false;
|
|
143
|
+
});
|
|
144
|
+
this.socket.on('status_update_ack', (data) => {
|
|
145
|
+
this.logger.debug(`Status update acknowledged: ${JSON.stringify(data)}`);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
async sendStatusUpdate(update) {
|
|
149
|
+
if (this.isConnected && this.socket?.connected) {
|
|
150
|
+
return this.sendViaWebSocket(update);
|
|
151
|
+
}
|
|
152
|
+
if (!this.isConnected) {
|
|
153
|
+
try {
|
|
154
|
+
await this.connect();
|
|
155
|
+
if (this.isConnected && this.socket?.connected) {
|
|
156
|
+
return this.sendViaWebSocket(update);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
this.logger.warn(`Failed to connect WebSocket: ${error.message}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (this.httpFallbackEnabled) {
|
|
164
|
+
this.logger.debug('WebSocket not available, using HTTP fallback');
|
|
165
|
+
return this.sendViaHttp(update);
|
|
166
|
+
}
|
|
167
|
+
this.logger.debug('Queueing status update for later delivery');
|
|
168
|
+
this.queueMessage(update);
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
async sendViaWebSocket(update) {
|
|
172
|
+
if (!this.socket || !this.socket.connected) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
try {
|
|
176
|
+
this.socket.emit('status_update', update);
|
|
177
|
+
this.logger.debug(`Sent status update via WebSocket: ${update.type} for ${update.profile_key}`);
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
this.logger.error(`Failed to send via WebSocket: ${error.message}`);
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async sendViaHttp(update) {
|
|
186
|
+
try {
|
|
187
|
+
const { ApiService } = await Promise.resolve().then(() => require('./api.service'));
|
|
188
|
+
const apiService = new ApiService(this.configService);
|
|
189
|
+
await apiService.initialize();
|
|
190
|
+
if (update.type === 'service_status') {
|
|
191
|
+
await apiService.callApi('PUT', `/docker-profiles/${update.profile_key}/services/status`, {
|
|
192
|
+
profile_key: update.profile_key,
|
|
193
|
+
workspace_id: update.workspace_id,
|
|
194
|
+
services: [
|
|
195
|
+
{
|
|
196
|
+
service_key: update.service_key,
|
|
197
|
+
service_name: update.service_name,
|
|
198
|
+
status: update.status,
|
|
199
|
+
container_id: update.container_id,
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
}, 3, 5000);
|
|
203
|
+
}
|
|
204
|
+
else if (update.type === 'profile_status') {
|
|
205
|
+
await apiService.callApi('PUT', `/docker-profiles/${update.profile_key}/status`, {
|
|
206
|
+
workspace_id: update.workspace_id,
|
|
207
|
+
is_active: update.is_active,
|
|
208
|
+
}, 3, 5000);
|
|
209
|
+
}
|
|
210
|
+
this.logger.debug(`Sent status update via HTTP: ${update.type}`);
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
this.logger.error(`Failed to send via HTTP: ${error.message}`);
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
queueMessage(update) {
|
|
219
|
+
const maxQueueSize = 1000;
|
|
220
|
+
if (this.messageQueue.length >= maxQueueSize) {
|
|
221
|
+
this.messageQueue.shift();
|
|
222
|
+
}
|
|
223
|
+
this.messageQueue.push(update);
|
|
224
|
+
this.logger.debug(`Queued status update (queue size: ${this.messageQueue.length})`);
|
|
225
|
+
}
|
|
226
|
+
async flushMessageQueue() {
|
|
227
|
+
if (this.messageQueue.length === 0) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
this.logger.log(`Flushing ${this.messageQueue.length} queued messages`);
|
|
231
|
+
const messagesToSend = [...this.messageQueue];
|
|
232
|
+
this.messageQueue = [];
|
|
233
|
+
for (const message of messagesToSend) {
|
|
234
|
+
try {
|
|
235
|
+
await this.sendViaWebSocket(message);
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
this.logger.error(`Failed to send queued message: ${error.message}`);
|
|
239
|
+
this.queueMessage(message);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
async getWebSocketUrl() {
|
|
244
|
+
const serverUrl = this.configService.serverUrl;
|
|
245
|
+
let wsUrl = serverUrl.replace(/^http/, 'ws');
|
|
246
|
+
wsUrl = wsUrl.replace(/\/$/, '');
|
|
247
|
+
return wsUrl;
|
|
248
|
+
}
|
|
249
|
+
disconnect() {
|
|
250
|
+
if (this.socket && (this.socket.connected || this.isConnected)) {
|
|
251
|
+
this.logger.log('Disconnecting WebSocket...');
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
this.logger.debug('Disconnect called but no active connection');
|
|
255
|
+
}
|
|
256
|
+
this.isConnected = false;
|
|
257
|
+
if (this.socket) {
|
|
258
|
+
this.socket.disconnect();
|
|
259
|
+
this.socket = null;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
onModuleDestroy() {
|
|
263
|
+
this.logger.debug('onModuleDestroy called - keeping WebSocket connection alive for daemon mode');
|
|
264
|
+
}
|
|
265
|
+
isWebSocketConnected() {
|
|
266
|
+
return this.isConnected && this.socket?.connected === true;
|
|
267
|
+
}
|
|
268
|
+
setHttpFallback(enabled) {
|
|
269
|
+
this.httpFallbackEnabled = enabled;
|
|
270
|
+
this.logger.log(`HTTP fallback ${enabled ? 'enabled' : 'disabled'}`);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
exports.WebSocketClientService = WebSocketClientService;
|
|
274
|
+
exports.WebSocketClientService = WebSocketClientService = WebSocketClientService_1 = __decorate([
|
|
275
|
+
(0, common_1.Injectable)(),
|
|
276
|
+
__metadata("design:paramtypes", [config_service_1.ConfigService])
|
|
277
|
+
], WebSocketClientService);
|
|
278
|
+
//# sourceMappingURL=websocket-client.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket-client.service.js","sourceRoot":"","sources":["../../../src/agent/services/websocket-client.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAKwB;AACxB,uDAA8C;AAC9C,qDAAiD;AAwB1C,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAiBjC,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAhB/B,WAAM,GAAG,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;QAC1D,WAAM,GAAkB,IAAI,CAAC;QAC7B,gBAAW,GAAG,KAAK,CAAC;QACpB,sBAAiB,G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IAGD,oBAAoB;QAClB,OAAO,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IAC7D,CAAC;IAGD,eAAe,CAAC,OAAgB;QAC9B,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;IACvE,CAAC;CACF,CAAA;AA/VY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;qCAkBwB,8BAAa;GAjBrC,sBAAsB,CA+VlC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AppModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const config_1 = require("@nestjs/config");
|
|
12
|
+
const schedule_1 = require("@nestjs/schedule");
|
|
13
|
+
const agent_module_1 = require("./agent/agent.module");
|
|
14
|
+
let AppModule = class AppModule {
|
|
15
|
+
};
|
|
16
|
+
exports.AppModule = AppModule;
|
|
17
|
+
exports.AppModule = AppModule = __decorate([
|
|
18
|
+
(0, common_1.Module)({
|
|
19
|
+
imports: [
|
|
20
|
+
config_1.ConfigModule.forRoot({
|
|
21
|
+
isGlobal: true,
|
|
22
|
+
envFilePath: ['.env.local', '.env'],
|
|
23
|
+
}),
|
|
24
|
+
schedule_1.ScheduleModule.forRoot(),
|
|
25
|
+
agent_module_1.AgentModule,
|
|
26
|
+
],
|
|
27
|
+
controllers: [],
|
|
28
|
+
providers: [],
|
|
29
|
+
})
|
|
30
|
+
], AppModule);
|
|
31
|
+
//# sourceMappingURL=app.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA8C;AAC9C,+CAAkD;AAClD,uDAAmD;AAc5C,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAZrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY,CAAC,OAAO,CAAC;gBACnB,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC;aACpC,CAAC;YACF,yBAAc,CAAC,OAAO,EAAE;YACxB,0BAAW;SACZ;QACD,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,EAAE;KACd,CAAC;GACW,SAAS,CAAG"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./app.module"), exports);
|
|
18
|
+
__exportStar(require("./agent/agent.module"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,uDAAqC"}
|
package/dist/main.d.ts
ADDED
package/dist/main.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const nest_commander_1 = require("nest-commander");
|
|
5
|
+
const app_module_1 = require("./app.module");
|
|
6
|
+
async function bootstrap() {
|
|
7
|
+
await nest_commander_1.CommandFactory.run(app_module_1.AppModule, {
|
|
8
|
+
logger: ['error', 'warn', 'log'],
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
bootstrap();
|
|
12
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;AAEA,mDAAgD;AAChD,6CAAyC;AAEzC,KAAK,UAAU,SAAS;IACtB,MAAM,+BAAc,CAAC,GAAG,CAAC,sBAAS,EAAE;QAClC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC;KACjC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,EAAE,CAAC"}
|