common-tg-service 1.2.72 → 1.2.74
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/dist/components/Telegram/Telegram.controller.js +111 -108
- package/dist/components/Telegram/Telegram.controller.js.map +1 -1
- package/dist/components/active-channels/active-channels.service.js +1 -0
- package/dist/components/active-channels/active-channels.service.js.map +1 -1
- package/dist/components/buffer-clients/buffer-client.controller.d.ts +1 -1
- package/dist/components/buffer-clients/buffer-client.controller.js +30 -16
- package/dist/components/buffer-clients/buffer-client.controller.js.map +1 -1
- package/dist/components/buffer-clients/buffer-client.service.d.ts +0 -1
- package/dist/components/buffer-clients/buffer-client.service.js +3 -22
- package/dist/components/buffer-clients/buffer-client.service.js.map +1 -1
- package/dist/components/builds/build.controller.js +2 -2
- package/dist/components/builds/build.controller.js.map +1 -1
- package/dist/components/channels/channels.service.js +1 -0
- package/dist/components/channels/channels.service.js.map +1 -1
- package/dist/components/clients/client.controller.js +241 -198
- package/dist/components/clients/client.controller.js.map +1 -1
- package/dist/components/promote-clients/promote-client.controller.js +51 -20
- package/dist/components/promote-clients/promote-client.controller.js.map +1 -1
- package/dist/components/promote-clients/promote-client.service.d.ts +0 -1
- package/dist/components/promote-clients/promote-client.service.js +7 -23
- package/dist/components/promote-clients/promote-client.service.js.map +1 -1
- package/dist/components/promote-clients/schemas/promote-client.schema.d.ts +2 -0
- package/dist/components/promote-clients/schemas/promote-client.schema.js +2 -1
- package/dist/components/promote-clients/schemas/promote-client.schema.js.map +1 -1
- package/dist/components/user-data/user-data.controller.js +60 -12
- package/dist/components/user-data/user-data.controller.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -65,11 +65,7 @@ let TelegramController = class TelegramController {
|
|
|
65
65
|
this.telegramService = telegramService;
|
|
66
66
|
}
|
|
67
67
|
async connect(mobile, autoDisconnect, handler, timeout) {
|
|
68
|
-
const options = {
|
|
69
|
-
autoDisconnect,
|
|
70
|
-
handler,
|
|
71
|
-
timeout
|
|
72
|
-
};
|
|
68
|
+
const options = { autoDisconnect, handler, timeout };
|
|
73
69
|
await this.telegramService.connect(mobile, options);
|
|
74
70
|
return { message: 'Connected successfully' };
|
|
75
71
|
}
|
|
@@ -175,9 +171,7 @@ let TelegramController = class TelegramController {
|
|
|
175
171
|
return this.telegramService.terminateSession(mobile, data);
|
|
176
172
|
}
|
|
177
173
|
async getConnectionStatus() {
|
|
178
|
-
return {
|
|
179
|
-
status: await this.telegramService.getConnectionStatus()
|
|
180
|
-
};
|
|
174
|
+
return { status: await this.telegramService.getConnectionStatus() };
|
|
181
175
|
}
|
|
182
176
|
async getCallLogStats(mobile) {
|
|
183
177
|
return this.telegramService.getCallLog(mobile);
|
|
@@ -186,7 +180,7 @@ let TelegramController = class TelegramController {
|
|
|
186
180
|
return this.telegramService.addContacts(mobile, contactsDto.phoneNumbers, contactsDto.prefix);
|
|
187
181
|
}
|
|
188
182
|
async getContacts(mobile) {
|
|
189
|
-
return
|
|
183
|
+
return this.telegramService.getContacts(mobile);
|
|
190
184
|
}
|
|
191
185
|
async sendMedia(mobile, sendMediaDto) {
|
|
192
186
|
const client = await connection_manager_1.connectionManager.getClient(mobile);
|
|
@@ -360,13 +354,7 @@ let TelegramController = class TelegramController {
|
|
|
360
354
|
return this.telegramService.hasPassword(mobile);
|
|
361
355
|
}
|
|
362
356
|
async getChats(mobile, limit, offsetDate, offsetId, offsetPeer, folderId) {
|
|
363
|
-
return this.telegramService.getChats(mobile, {
|
|
364
|
-
limit,
|
|
365
|
-
offsetDate,
|
|
366
|
-
offsetId,
|
|
367
|
-
offsetPeer,
|
|
368
|
-
folderId
|
|
369
|
-
});
|
|
357
|
+
return this.telegramService.getChats(mobile, { limit, offsetDate, offsetId, offsetPeer, folderId });
|
|
370
358
|
}
|
|
371
359
|
async getFileUrl(mobile, url, filename) {
|
|
372
360
|
return this.telegramService.getFileUrl(mobile, url, filename);
|
|
@@ -392,8 +380,7 @@ __decorate([
|
|
|
392
380
|
(0, swagger_1.ApiQuery)({ name: 'autoDisconnect', description: 'Whether to auto disconnect the client after period of inactivity', required: false, type: Boolean, default: true }),
|
|
393
381
|
(0, swagger_1.ApiQuery)({ name: 'handler', description: 'Whether to use event handler', required: false, type: Boolean, default: true }),
|
|
394
382
|
(0, swagger_1.ApiQuery)({ name: 'timeout', description: 'Connection timeout in milliseconds', required: false, type: Number, default: 30000 }),
|
|
395
|
-
(0, swagger_1.ApiResponse)({
|
|
396
|
-
(0, swagger_1.ApiResponse)({ status: 400, description: 'Connection failed' }),
|
|
383
|
+
(0, swagger_1.ApiResponse)({ type: Object, schema: { properties: { message: { type: 'string' } } } }),
|
|
397
384
|
__param(0, (0, common_1.Param)('mobile')),
|
|
398
385
|
__param(1, (0, common_1.Query)('autoDisconnect')),
|
|
399
386
|
__param(2, (0, common_1.Query)('handler')),
|
|
@@ -406,7 +393,7 @@ __decorate([
|
|
|
406
393
|
(0, common_1.Get)('disconnect/:mobile'),
|
|
407
394
|
(0, swagger_1.ApiOperation)({ summary: 'Disconnect from Telegram' }),
|
|
408
395
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
409
|
-
(0, swagger_1.ApiResponse)({
|
|
396
|
+
(0, swagger_1.ApiResponse)({ type: Object, schema: { properties: { message: { type: 'string' } } } }),
|
|
410
397
|
__param(0, (0, common_1.Param)('mobile')),
|
|
411
398
|
__metadata("design:type", Function),
|
|
412
399
|
__metadata("design:paramtypes", [String]),
|
|
@@ -415,7 +402,7 @@ __decorate([
|
|
|
415
402
|
__decorate([
|
|
416
403
|
(0, common_1.Get)('disconnect-all'),
|
|
417
404
|
(0, swagger_1.ApiOperation)({ summary: 'Disconnect all clients' }),
|
|
418
|
-
(0, swagger_1.ApiResponse)({
|
|
405
|
+
(0, swagger_1.ApiResponse)({ type: Object, schema: { properties: { message: { type: 'string' } } } }),
|
|
419
406
|
__metadata("design:type", Function),
|
|
420
407
|
__metadata("design:paramtypes", []),
|
|
421
408
|
__metadata("design:returntype", Promise)
|
|
@@ -423,7 +410,7 @@ __decorate([
|
|
|
423
410
|
__decorate([
|
|
424
411
|
(0, common_1.Get)('connection/stats'),
|
|
425
412
|
(0, swagger_1.ApiOperation)({ summary: 'Get connection statistics' }),
|
|
426
|
-
(0, swagger_1.ApiResponse)({
|
|
413
|
+
(0, swagger_1.ApiResponse)({ type: connection_management_dto_1.ConnectionStatsDto }),
|
|
427
414
|
__metadata("design:type", Function),
|
|
428
415
|
__metadata("design:paramtypes", []),
|
|
429
416
|
__metadata("design:returntype", connection_management_dto_1.ConnectionStatsDto)
|
|
@@ -432,8 +419,7 @@ __decorate([
|
|
|
432
419
|
(0, common_1.Get)('connection/state/:mobile'),
|
|
433
420
|
(0, swagger_1.ApiOperation)({ summary: 'Get connection state for a client' }),
|
|
434
421
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
435
|
-
(0, swagger_1.ApiResponse)({
|
|
436
|
-
(0, swagger_1.ApiResponse)({ status: 404, description: 'Client not found' }),
|
|
422
|
+
(0, swagger_1.ApiResponse)({ type: connection_management_dto_1.ConnectionStatusDto }),
|
|
437
423
|
__param(0, (0, common_1.Param)('mobile')),
|
|
438
424
|
__metadata("design:type", Function),
|
|
439
425
|
__metadata("design:paramtypes", [String]),
|
|
@@ -442,7 +428,7 @@ __decorate([
|
|
|
442
428
|
__decorate([
|
|
443
429
|
(0, common_1.Get)('connection/count'),
|
|
444
430
|
(0, swagger_1.ApiOperation)({ summary: 'Get active connection count' }),
|
|
445
|
-
(0, swagger_1.ApiResponse)({
|
|
431
|
+
(0, swagger_1.ApiResponse)({ type: Number }),
|
|
446
432
|
__metadata("design:type", Function),
|
|
447
433
|
__metadata("design:paramtypes", []),
|
|
448
434
|
__metadata("design:returntype", Number)
|
|
@@ -451,7 +437,7 @@ __decorate([
|
|
|
451
437
|
(0, common_1.Get)('me/:mobile'),
|
|
452
438
|
(0, swagger_1.ApiOperation)({ summary: 'Get current user profile' }),
|
|
453
439
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
454
|
-
(0, swagger_1.ApiResponse)({
|
|
440
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
455
441
|
__param(0, (0, common_1.Param)('mobile')),
|
|
456
442
|
__metadata("design:type", Function),
|
|
457
443
|
__metadata("design:paramtypes", [String]),
|
|
@@ -462,7 +448,7 @@ __decorate([
|
|
|
462
448
|
(0, swagger_1.ApiOperation)({ summary: 'Get Entity profile' }),
|
|
463
449
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
464
450
|
(0, swagger_1.ApiParam)({ name: 'entity', description: 'Entity identifier', required: true }),
|
|
465
|
-
(0, swagger_1.ApiResponse)({
|
|
451
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
466
452
|
__param(0, (0, common_1.Param)('mobile')),
|
|
467
453
|
__param(1, (0, common_1.Param)('entity')),
|
|
468
454
|
__metadata("design:type", Function),
|
|
@@ -474,6 +460,7 @@ __decorate([
|
|
|
474
460
|
(0, swagger_1.ApiOperation)({ summary: 'Update profile information' }),
|
|
475
461
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
476
462
|
(0, swagger_1.ApiBody)({ type: dto_1.UpdateProfileDto }),
|
|
463
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
477
464
|
__param(0, (0, common_1.Param)('mobile')),
|
|
478
465
|
__param(1, (0, common_1.Body)()),
|
|
479
466
|
__metadata("design:type", Function),
|
|
@@ -485,6 +472,7 @@ __decorate([
|
|
|
485
472
|
(0, swagger_1.ApiOperation)({ summary: 'Set profile photo' }),
|
|
486
473
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
487
474
|
(0, swagger_1.ApiBody)({ type: dto_1.ProfilePhotoDto }),
|
|
475
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
488
476
|
__param(0, (0, common_1.Param)('mobile')),
|
|
489
477
|
__param(1, (0, common_1.Body)()),
|
|
490
478
|
__metadata("design:type", Function),
|
|
@@ -495,6 +483,7 @@ __decorate([
|
|
|
495
483
|
(0, common_1.Delete)('profile/photos/:mobile'),
|
|
496
484
|
(0, swagger_1.ApiOperation)({ summary: 'Delete all profile photos' }),
|
|
497
485
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
486
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
498
487
|
__param(0, (0, common_1.Param)('mobile')),
|
|
499
488
|
__metadata("design:type", Function),
|
|
500
489
|
__metadata("design:paramtypes", [String]),
|
|
@@ -506,6 +495,7 @@ __decorate([
|
|
|
506
495
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
507
496
|
(0, swagger_1.ApiQuery)({ name: 'chatId', required: true }),
|
|
508
497
|
(0, swagger_1.ApiQuery)({ name: 'limit', required: false, type: Number }),
|
|
498
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
509
499
|
__param(0, (0, common_1.Param)('mobile')),
|
|
510
500
|
__param(1, (0, common_1.Query)('chatId')),
|
|
511
501
|
__param(2, (0, common_1.Query)('limit')),
|
|
@@ -516,12 +506,9 @@ __decorate([
|
|
|
516
506
|
__decorate([
|
|
517
507
|
(0, common_1.Post)('message/:mobile'),
|
|
518
508
|
(0, swagger_1.ApiOperation)({ summary: 'Send a Telegram message as a user' }),
|
|
519
|
-
(0, swagger_1.ApiParam)({
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
required: true,
|
|
523
|
-
example: '1234567890',
|
|
524
|
-
}),
|
|
509
|
+
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number of the user account to send the message from', required: true }),
|
|
510
|
+
(0, swagger_1.ApiBody)({ type: send_message_dto_1.SendMessageDto }),
|
|
511
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
525
512
|
__param(0, (0, common_1.Param)('mobile')),
|
|
526
513
|
__param(1, (0, common_1.Body)()),
|
|
527
514
|
__metadata("design:type", Function),
|
|
@@ -533,6 +520,7 @@ __decorate([
|
|
|
533
520
|
(0, swagger_1.ApiOperation)({ summary: 'Forward messages' }),
|
|
534
521
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
535
522
|
(0, swagger_1.ApiBody)({ type: dto_1.ForwardBatchDto }),
|
|
523
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
536
524
|
__param(0, (0, common_1.Param)('mobile')),
|
|
537
525
|
__param(1, (0, common_1.Body)()),
|
|
538
526
|
__metadata("design:type", Function),
|
|
@@ -544,6 +532,7 @@ __decorate([
|
|
|
544
532
|
(0, swagger_1.ApiOperation)({ summary: 'Process operations in batches' }),
|
|
545
533
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
546
534
|
(0, swagger_1.ApiBody)({ type: dto_1.BatchProcessDto }),
|
|
535
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
547
536
|
__param(0, (0, common_1.Param)('mobile')),
|
|
548
537
|
__param(1, (0, common_1.Body)()),
|
|
549
538
|
__metadata("design:type", Function),
|
|
@@ -552,17 +541,10 @@ __decorate([
|
|
|
552
541
|
], TelegramController.prototype, "processBatchMessages", null);
|
|
553
542
|
__decorate([
|
|
554
543
|
(0, common_1.Get)('messages/search/:mobile'),
|
|
555
|
-
(0, swagger_1.ApiOperation)({
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}),
|
|
559
|
-
(0, swagger_1.ApiOkResponse)({
|
|
560
|
-
description: 'Messages successfully found',
|
|
561
|
-
type: message_search_dto_1.SearchMessagesResponseDto
|
|
562
|
-
}),
|
|
563
|
-
(0, swagger_1.ApiBadRequestResponse)({ description: 'Invalid request parameters' }),
|
|
564
|
-
(0, swagger_1.ApiNotFoundResponse)({ description: 'Mobile number not registered' }),
|
|
565
|
-
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Unauthorized access' }),
|
|
544
|
+
(0, swagger_1.ApiOperation)({ summary: 'Search messages in Telegram', description: 'Search for messages in a specific chat or globally across all chats' }),
|
|
545
|
+
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
546
|
+
(0, swagger_1.ApiQuery)({ type: message_search_dto_1.SearchMessagesDto }),
|
|
547
|
+
(0, swagger_1.ApiResponse)({ type: message_search_dto_1.SearchMessagesResponseDto }),
|
|
566
548
|
__param(0, (0, common_1.Param)('mobile')),
|
|
567
549
|
__param(1, (0, common_1.Query)()),
|
|
568
550
|
__metadata("design:type", Function),
|
|
@@ -574,6 +556,7 @@ __decorate([
|
|
|
574
556
|
(0, swagger_1.ApiOperation)({ summary: 'Get channel information' }),
|
|
575
557
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
576
558
|
(0, swagger_1.ApiQuery)({ name: 'includeIds', required: false, type: Boolean }),
|
|
559
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
577
560
|
__param(0, (0, common_1.Param)('mobile')),
|
|
578
561
|
__param(1, (0, common_1.Query)('includeIds')),
|
|
579
562
|
__metadata("design:type", Function),
|
|
@@ -586,6 +569,7 @@ __decorate([
|
|
|
586
569
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
587
570
|
(0, swagger_1.ApiQuery)({ name: 'channel', description: 'Channel username or ID', required: false }),
|
|
588
571
|
(0, swagger_1.ApiQuery)({ name: 'fromChatId', description: 'Source chat ID to forward messages from', required: false }),
|
|
572
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
589
573
|
__param(0, (0, common_1.Param)('mobile')),
|
|
590
574
|
__param(1, (0, common_1.Query)('channel')),
|
|
591
575
|
__param(2, (0, common_1.Query)('fromChatId')),
|
|
@@ -598,6 +582,7 @@ __decorate([
|
|
|
598
582
|
(0, swagger_1.ApiOperation)({ summary: 'Leave channel' }),
|
|
599
583
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
600
584
|
(0, swagger_1.ApiQuery)({ name: 'channel', description: 'Channel ID/username', required: true }),
|
|
585
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
601
586
|
__param(0, (0, common_1.Param)('mobile')),
|
|
602
587
|
__param(1, (0, common_1.Query)('channel')),
|
|
603
588
|
__metadata("design:type", Function),
|
|
@@ -607,12 +592,9 @@ __decorate([
|
|
|
607
592
|
__decorate([
|
|
608
593
|
(0, common_1.Patch)('username/:mobile'),
|
|
609
594
|
(0, swagger_1.ApiOperation)({ summary: 'Update the Telegram username of a user' }),
|
|
610
|
-
(0, swagger_1.ApiParam)({
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
required: true,
|
|
614
|
-
example: '1234567890',
|
|
615
|
-
}),
|
|
595
|
+
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number of the user whose username should be updated', required: true }),
|
|
596
|
+
(0, swagger_1.ApiBody)({ type: update_username_dto_1.UpdateUsernameDto }),
|
|
597
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
616
598
|
__param(0, (0, common_1.Param)('mobile')),
|
|
617
599
|
__param(1, (0, common_1.Body)()),
|
|
618
600
|
__metadata("design:type", Function),
|
|
@@ -623,6 +605,7 @@ __decorate([
|
|
|
623
605
|
(0, common_1.Post)('2fa/:mobile'),
|
|
624
606
|
(0, swagger_1.ApiOperation)({ summary: 'Setup two-factor authentication' }),
|
|
625
607
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
608
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
626
609
|
__param(0, (0, common_1.Param)('mobile')),
|
|
627
610
|
__metadata("design:type", Function),
|
|
628
611
|
__metadata("design:paramtypes", [String]),
|
|
@@ -632,6 +615,7 @@ __decorate([
|
|
|
632
615
|
(0, common_1.Post)('privacy/:mobile'),
|
|
633
616
|
(0, swagger_1.ApiOperation)({ summary: 'Update privacy settings' }),
|
|
634
617
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
618
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
635
619
|
__param(0, (0, common_1.Param)('mobile')),
|
|
636
620
|
__metadata("design:type", Function),
|
|
637
621
|
__metadata("design:paramtypes", [String]),
|
|
@@ -642,6 +626,7 @@ __decorate([
|
|
|
642
626
|
(0, swagger_1.ApiOperation)({ summary: 'Update multiple privacy settings' }),
|
|
643
627
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
644
628
|
(0, swagger_1.ApiBody)({ type: dto_1.PrivacySettingsDto }),
|
|
629
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
645
630
|
__param(0, (0, common_1.Param)('mobile')),
|
|
646
631
|
__param(1, (0, common_1.Body)()),
|
|
647
632
|
__metadata("design:type", Function),
|
|
@@ -652,7 +637,7 @@ __decorate([
|
|
|
652
637
|
(0, common_1.Get)('sessions/:mobile'),
|
|
653
638
|
(0, swagger_1.ApiOperation)({ summary: 'Get active sessions' }),
|
|
654
639
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
655
|
-
(0, swagger_1.ApiResponse)({
|
|
640
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
656
641
|
__param(0, (0, common_1.Param)('mobile')),
|
|
657
642
|
__metadata("design:type", Function),
|
|
658
643
|
__metadata("design:paramtypes", [String]),
|
|
@@ -662,7 +647,7 @@ __decorate([
|
|
|
662
647
|
(0, common_1.Delete)('sessions/:mobile'),
|
|
663
648
|
(0, swagger_1.ApiOperation)({ summary: 'Terminate other sessions' }),
|
|
664
649
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
665
|
-
(0, swagger_1.ApiResponse)({
|
|
650
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
666
651
|
__param(0, (0, common_1.Param)('mobile')),
|
|
667
652
|
__metadata("design:type", Function),
|
|
668
653
|
__metadata("design:paramtypes", [String]),
|
|
@@ -672,7 +657,7 @@ __decorate([
|
|
|
672
657
|
(0, common_1.Post)('sessions/new/:mobile'),
|
|
673
658
|
(0, swagger_1.ApiOperation)({ summary: 'Create new session' }),
|
|
674
659
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
675
|
-
(0, swagger_1.ApiResponse)({
|
|
660
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
676
661
|
__param(0, (0, common_1.Param)('mobile')),
|
|
677
662
|
__metadata("design:type", Function),
|
|
678
663
|
__metadata("design:paramtypes", [String]),
|
|
@@ -682,6 +667,7 @@ __decorate([
|
|
|
682
667
|
(0, common_1.Get)('session/info/:mobile'),
|
|
683
668
|
(0, swagger_1.ApiOperation)({ summary: 'Get session information' }),
|
|
684
669
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
670
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
685
671
|
__param(0, (0, common_1.Param)('mobile')),
|
|
686
672
|
__metadata("design:type", Function),
|
|
687
673
|
__metadata("design:paramtypes", [String]),
|
|
@@ -691,6 +677,8 @@ __decorate([
|
|
|
691
677
|
(0, common_1.Post)('session/terminate/:mobile'),
|
|
692
678
|
(0, swagger_1.ApiOperation)({ summary: 'Terminate specific session' }),
|
|
693
679
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
680
|
+
(0, swagger_1.ApiBody)({ schema: { type: 'object', properties: { hash: { type: 'string' }, type: { type: 'string', enum: ['app', 'web'] }, exceptCurrent: { type: 'boolean' } } } }),
|
|
681
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
694
682
|
__param(0, (0, common_1.Param)('mobile')),
|
|
695
683
|
__param(1, (0, common_1.Body)()),
|
|
696
684
|
__metadata("design:type", Function),
|
|
@@ -700,7 +688,7 @@ __decorate([
|
|
|
700
688
|
__decorate([
|
|
701
689
|
(0, common_1.Get)('monitoring/status'),
|
|
702
690
|
(0, swagger_1.ApiOperation)({ summary: 'Get service health and connection status' }),
|
|
703
|
-
(0, swagger_1.ApiResponse)({
|
|
691
|
+
(0, swagger_1.ApiResponse)({ type: connection_management_dto_1.ConnectionStatusDto }),
|
|
704
692
|
__metadata("design:type", Function),
|
|
705
693
|
__metadata("design:paramtypes", []),
|
|
706
694
|
__metadata("design:returntype", Promise)
|
|
@@ -709,6 +697,7 @@ __decorate([
|
|
|
709
697
|
(0, common_1.Get)('monitoring/calllog/:mobile'),
|
|
710
698
|
(0, swagger_1.ApiOperation)({ summary: 'Get call log statistics' }),
|
|
711
699
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
700
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
712
701
|
__param(0, (0, common_1.Param)('mobile')),
|
|
713
702
|
__metadata("design:type", Function),
|
|
714
703
|
__metadata("design:paramtypes", [String]),
|
|
@@ -719,7 +708,7 @@ __decorate([
|
|
|
719
708
|
(0, swagger_1.ApiOperation)({ summary: 'Add multiple contacts in bulk' }),
|
|
720
709
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
721
710
|
(0, swagger_1.ApiBody)({ type: dto_1.AddContactsDto }),
|
|
722
|
-
(0, swagger_1.ApiResponse)({
|
|
711
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
723
712
|
__param(0, (0, common_1.Param)('mobile')),
|
|
724
713
|
__param(1, (0, common_1.Body)()),
|
|
725
714
|
__metadata("design:type", Function),
|
|
@@ -730,7 +719,7 @@ __decorate([
|
|
|
730
719
|
(0, common_1.Get)('contacts/:mobile'),
|
|
731
720
|
(0, swagger_1.ApiOperation)({ summary: 'Get all contacts' }),
|
|
732
721
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
733
|
-
(0, swagger_1.ApiResponse)({
|
|
722
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
734
723
|
__param(0, (0, common_1.Param)('mobile')),
|
|
735
724
|
__metadata("design:type", Function),
|
|
736
725
|
__metadata("design:paramtypes", [String]),
|
|
@@ -741,6 +730,7 @@ __decorate([
|
|
|
741
730
|
(0, swagger_1.ApiOperation)({ summary: 'Send media message' }),
|
|
742
731
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
743
732
|
(0, swagger_1.ApiBody)({ type: dto_1.SendMediaDto }),
|
|
733
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
744
734
|
__param(0, (0, common_1.Param)('mobile')),
|
|
745
735
|
__param(1, (0, common_1.Body)()),
|
|
746
736
|
__metadata("design:type", Function),
|
|
@@ -753,6 +743,7 @@ __decorate([
|
|
|
753
743
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
754
744
|
(0, swagger_1.ApiQuery)({ name: 'chatId', required: true }),
|
|
755
745
|
(0, swagger_1.ApiQuery)({ name: 'messageId', required: true }),
|
|
746
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
756
747
|
__param(0, (0, common_1.Param)('mobile')),
|
|
757
748
|
__param(1, (0, common_1.Query)('chatId')),
|
|
758
749
|
__param(2, (0, common_1.Query)('messageId')),
|
|
@@ -766,6 +757,7 @@ __decorate([
|
|
|
766
757
|
(0, swagger_1.ApiOperation)({ summary: 'Send media album (multiple photos/videos)' }),
|
|
767
758
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
768
759
|
(0, swagger_1.ApiBody)({ type: dto_1.SendMediaAlbumDto }),
|
|
760
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
769
761
|
__param(0, (0, common_1.Param)('mobile')),
|
|
770
762
|
__param(1, (0, common_1.Body)()),
|
|
771
763
|
__metadata("design:type", Function),
|
|
@@ -783,6 +775,8 @@ __decorate([
|
|
|
783
775
|
(0, swagger_1.ApiQuery)({ name: 'limit', description: 'Number of messages to fetch', required: false, type: Number }),
|
|
784
776
|
(0, swagger_1.ApiQuery)({ name: 'minId', required: false, type: Number }),
|
|
785
777
|
(0, swagger_1.ApiQuery)({ name: 'maxId', required: false, type: Number }),
|
|
778
|
+
(0, swagger_1.ApiQuery)({ name: 'all', required: false, type: Boolean }),
|
|
779
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
786
780
|
__param(0, (0, common_1.Param)('mobile')),
|
|
787
781
|
__param(1, (0, common_1.Query)('chatId')),
|
|
788
782
|
__param(2, (0, common_1.Query)('types')),
|
|
@@ -807,7 +801,7 @@ __decorate([
|
|
|
807
801
|
(0, swagger_1.ApiQuery)({ name: 'limit', required: false, type: Number, description: 'Number of media items to fetch' }),
|
|
808
802
|
(0, swagger_1.ApiQuery)({ name: 'minId', required: false, type: Number, description: 'Minimum message ID' }),
|
|
809
803
|
(0, swagger_1.ApiQuery)({ name: 'maxId', required: false, type: Number, description: 'Maximum message ID' }),
|
|
810
|
-
(0, swagger_1.ApiResponse)({
|
|
804
|
+
(0, swagger_1.ApiResponse)({ type: [metadata_operations_dto_1.MediaMetadataDto] }),
|
|
811
805
|
__param(0, (0, common_1.Param)('mobile')),
|
|
812
806
|
__param(1, (0, common_1.Query)('chatId')),
|
|
813
807
|
__param(2, (0, common_1.Query)('types')),
|
|
@@ -825,6 +819,7 @@ __decorate([
|
|
|
825
819
|
(0, swagger_1.ApiOperation)({ summary: 'Get group members' }),
|
|
826
820
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
827
821
|
(0, swagger_1.ApiQuery)({ name: 'groupId', description: 'Group ID', required: true }),
|
|
822
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
828
823
|
__param(0, (0, common_1.Param)('mobile')),
|
|
829
824
|
__param(1, (0, common_1.Query)('groupId')),
|
|
830
825
|
__metadata("design:type", Function),
|
|
@@ -836,6 +831,7 @@ __decorate([
|
|
|
836
831
|
(0, swagger_1.ApiOperation)({ summary: 'Block a chat/user' }),
|
|
837
832
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
838
833
|
(0, swagger_1.ApiQuery)({ name: 'chatId', description: 'Chat/User ID to block', required: true }),
|
|
834
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
839
835
|
__param(0, (0, common_1.Param)('mobile')),
|
|
840
836
|
__param(1, (0, common_1.Query)('chatId')),
|
|
841
837
|
__metadata("design:type", Function),
|
|
@@ -845,23 +841,14 @@ __decorate([
|
|
|
845
841
|
__decorate([
|
|
846
842
|
(0, common_1.Delete)('chat/:mobile'),
|
|
847
843
|
(0, swagger_1.ApiOperation)({ summary: 'Delete or clear a chat history for a user' }),
|
|
848
|
-
(0, swagger_1.ApiParam)({
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
}),
|
|
854
|
-
(0, swagger_1.ApiQuery)({
|
|
855
|
-
|
|
856
|
-
description: 'Username or Peer ID of the chat to delete',
|
|
857
|
-
required: true,
|
|
858
|
-
example: 'someusername',
|
|
859
|
-
}),
|
|
860
|
-
(0, swagger_1.ApiQuery)({ name: 'maxId', required: false, description: 'Delete messages with ID ≤ maxId', example: 100000 }),
|
|
861
|
-
(0, swagger_1.ApiQuery)({ name: 'justClear', required: false, description: 'Only clear history for this user', example: false }),
|
|
862
|
-
(0, swagger_1.ApiQuery)({ name: 'revoke', required: false, description: 'Delete for everyone if possible', example: true }),
|
|
863
|
-
(0, swagger_1.ApiQuery)({ name: 'minDate', required: false, description: 'Minimum date (UNIX timestamp)', example: 1609459200 }),
|
|
864
|
-
(0, swagger_1.ApiQuery)({ name: 'maxDate', required: false, description: 'Maximum date (UNIX timestamp)', example: 1612137600 }),
|
|
844
|
+
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number of the user whose chat should be deleted', required: true }),
|
|
845
|
+
(0, swagger_1.ApiQuery)({ name: 'peer', description: 'Username or Peer ID of the chat to delete', required: true }),
|
|
846
|
+
(0, swagger_1.ApiQuery)({ name: 'maxId', required: false, description: 'Delete messages with ID ≤ maxId' }),
|
|
847
|
+
(0, swagger_1.ApiQuery)({ name: 'justClear', required: false, description: 'Only clear history for this user', type: Boolean }),
|
|
848
|
+
(0, swagger_1.ApiQuery)({ name: 'revoke', required: false, description: 'Delete for everyone if possible', type: Boolean }),
|
|
849
|
+
(0, swagger_1.ApiQuery)({ name: 'minDate', required: false, description: 'Minimum date (UNIX timestamp)' }),
|
|
850
|
+
(0, swagger_1.ApiQuery)({ name: 'maxDate', required: false, description: 'Maximum date (UNIX timestamp)' }),
|
|
851
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
865
852
|
__param(0, (0, common_1.Param)('mobile')),
|
|
866
853
|
__param(1, (0, common_1.Query)()),
|
|
867
854
|
__metadata("design:type", Function),
|
|
@@ -875,6 +862,7 @@ __decorate([
|
|
|
875
862
|
(0, swagger_1.ApiQuery)({ name: 'chatId', required: true }),
|
|
876
863
|
(0, swagger_1.ApiQuery)({ name: 'message', required: true }),
|
|
877
864
|
(0, swagger_1.ApiQuery)({ name: 'url', required: true }),
|
|
865
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
878
866
|
__param(0, (0, common_1.Param)('mobile')),
|
|
879
867
|
__param(1, (0, common_1.Query)('chatId')),
|
|
880
868
|
__param(2, (0, common_1.Query)('message')),
|
|
@@ -890,6 +878,7 @@ __decorate([
|
|
|
890
878
|
(0, swagger_1.ApiQuery)({ name: 'limit', required: false, type: Number, description: 'Number of dialogs to fetch', default: 500 }),
|
|
891
879
|
(0, swagger_1.ApiQuery)({ name: 'offsetId', required: false, type: Number, description: 'Offset ID for pagination', default: 0 }),
|
|
892
880
|
(0, swagger_1.ApiQuery)({ name: 'archived', required: false, type: Boolean, description: 'Include archived chats', default: false }),
|
|
881
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
893
882
|
__param(0, (0, common_1.Param)('mobile')),
|
|
894
883
|
__param(1, (0, common_1.Query)('limit')),
|
|
895
884
|
__param(2, (0, common_1.Query)('offsetId')),
|
|
@@ -902,7 +891,7 @@ __decorate([
|
|
|
902
891
|
(0, common_1.Get)('last-active/:mobile'),
|
|
903
892
|
(0, swagger_1.ApiOperation)({ summary: 'Get last active time' }),
|
|
904
893
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
905
|
-
(0, swagger_1.ApiResponse)({
|
|
894
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
906
895
|
__param(0, (0, common_1.Param)('mobile')),
|
|
907
896
|
__metadata("design:type", Function),
|
|
908
897
|
__metadata("design:paramtypes", [String]),
|
|
@@ -913,6 +902,7 @@ __decorate([
|
|
|
913
902
|
(0, swagger_1.ApiOperation)({ summary: 'Create a new group with advanced options' }),
|
|
914
903
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
915
904
|
(0, swagger_1.ApiBody)({ type: dto_1.createGroupDto }),
|
|
905
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
916
906
|
__param(0, (0, common_1.Param)('mobile')),
|
|
917
907
|
__param(1, (0, common_1.Body)()),
|
|
918
908
|
__metadata("design:type", Function),
|
|
@@ -924,6 +914,7 @@ __decorate([
|
|
|
924
914
|
(0, swagger_1.ApiOperation)({ summary: 'Update group settings' }),
|
|
925
915
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
926
916
|
(0, swagger_1.ApiBody)({ type: dto_1.GroupSettingsDto }),
|
|
917
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
927
918
|
__param(0, (0, common_1.Param)('mobile')),
|
|
928
919
|
__param(1, (0, common_1.Body)()),
|
|
929
920
|
__metadata("design:type", Function),
|
|
@@ -935,6 +926,7 @@ __decorate([
|
|
|
935
926
|
(0, swagger_1.ApiOperation)({ summary: 'Add members to a group' }),
|
|
936
927
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
937
928
|
(0, swagger_1.ApiBody)({ type: dto_1.GroupMemberOperationDto }),
|
|
929
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
938
930
|
__param(0, (0, common_1.Body)()),
|
|
939
931
|
__param(1, (0, common_1.Param)('mobile')),
|
|
940
932
|
__metadata("design:type", Function),
|
|
@@ -946,6 +938,7 @@ __decorate([
|
|
|
946
938
|
(0, swagger_1.ApiOperation)({ summary: 'Remove members from a group' }),
|
|
947
939
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
948
940
|
(0, swagger_1.ApiBody)({ type: dto_1.GroupMemberOperationDto }),
|
|
941
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
949
942
|
__param(0, (0, common_1.Body)()),
|
|
950
943
|
__param(1, (0, common_1.Param)('mobile')),
|
|
951
944
|
__metadata("design:type", Function),
|
|
@@ -957,6 +950,7 @@ __decorate([
|
|
|
957
950
|
(0, swagger_1.ApiOperation)({ summary: 'Promote or demote group admins' }),
|
|
958
951
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
959
952
|
(0, swagger_1.ApiBody)({ type: dto_1.AdminOperationDto }),
|
|
953
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
960
954
|
__param(0, (0, common_1.Body)()),
|
|
961
955
|
__param(1, (0, common_1.Param)('mobile')),
|
|
962
956
|
__metadata("design:type", Function),
|
|
@@ -968,6 +962,7 @@ __decorate([
|
|
|
968
962
|
(0, swagger_1.ApiOperation)({ summary: 'Clean up chat history' }),
|
|
969
963
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
970
964
|
(0, swagger_1.ApiBody)({ type: dto_1.ChatCleanupDto }),
|
|
965
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
971
966
|
__param(0, (0, common_1.Param)('mobile')),
|
|
972
967
|
__param(1, (0, common_1.Body)()),
|
|
973
968
|
__metadata("design:type", Function),
|
|
@@ -992,6 +987,7 @@ __decorate([
|
|
|
992
987
|
(0, swagger_1.ApiOperation)({ summary: 'Schedule a message' }),
|
|
993
988
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
994
989
|
(0, swagger_1.ApiBody)({ type: dto_1.ScheduleMessageDto }),
|
|
990
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
995
991
|
__param(0, (0, common_1.Param)('mobile')),
|
|
996
992
|
__param(1, (0, common_1.Body)()),
|
|
997
993
|
__metadata("design:type", Function),
|
|
@@ -1003,6 +999,7 @@ __decorate([
|
|
|
1003
999
|
(0, swagger_1.ApiOperation)({ summary: 'Get scheduled messages' }),
|
|
1004
1000
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1005
1001
|
(0, swagger_1.ApiQuery)({ name: 'chatId', description: 'Chat ID', required: true }),
|
|
1002
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1006
1003
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1007
1004
|
__param(1, (0, common_1.Query)('chatId')),
|
|
1008
1005
|
__metadata("design:type", Function),
|
|
@@ -1013,6 +1010,8 @@ __decorate([
|
|
|
1013
1010
|
(0, common_1.Post)('media/voice/:mobile'),
|
|
1014
1011
|
(0, swagger_1.ApiOperation)({ summary: 'Send voice message' }),
|
|
1015
1012
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1013
|
+
(0, swagger_1.ApiBody)({ schema: { type: 'object', properties: { chatId: { type: 'string' }, url: { type: 'string' }, duration: { type: 'number' }, caption: { type: 'string' } } } }),
|
|
1014
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1016
1015
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1017
1016
|
__param(1, (0, common_1.Body)()),
|
|
1018
1017
|
__metadata("design:type", Function),
|
|
@@ -1039,11 +1038,8 @@ __decorate([
|
|
|
1039
1038
|
required: ['chatId', 'sourceType']
|
|
1040
1039
|
}
|
|
1041
1040
|
}),
|
|
1042
|
-
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('binaryData', {
|
|
1043
|
-
|
|
1044
|
-
})),
|
|
1045
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'View once media sent successfully' }),
|
|
1046
|
-
(0, swagger_1.ApiResponse)({ status: 400, description: 'Failed to send view once media' }),
|
|
1041
|
+
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('binaryData', { storage: multer.memoryStorage() })),
|
|
1042
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1047
1043
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1048
1044
|
__param(1, (0, common_1.UploadedFile)()),
|
|
1049
1045
|
__param(2, (0, common_1.Body)()),
|
|
@@ -1058,6 +1054,7 @@ __decorate([
|
|
|
1058
1054
|
(0, swagger_1.ApiQuery)({ name: 'chatId', required: true }),
|
|
1059
1055
|
(0, swagger_1.ApiQuery)({ name: 'offset', required: false, type: Number }),
|
|
1060
1056
|
(0, swagger_1.ApiQuery)({ name: 'limit', required: false, type: Number }),
|
|
1057
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1061
1058
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1062
1059
|
__param(1, (0, common_1.Query)('chatId')),
|
|
1063
1060
|
__param(2, (0, common_1.Query)('offset')),
|
|
@@ -1071,6 +1068,7 @@ __decorate([
|
|
|
1071
1068
|
(0, swagger_1.ApiOperation)({ summary: 'Promote members to admin' }),
|
|
1072
1069
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1073
1070
|
(0, swagger_1.ApiBody)({ type: dto_1.AdminOperationDto }),
|
|
1071
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1074
1072
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1075
1073
|
__param(1, (0, common_1.Body)()),
|
|
1076
1074
|
__metadata("design:type", Function),
|
|
@@ -1082,6 +1080,7 @@ __decorate([
|
|
|
1082
1080
|
(0, swagger_1.ApiOperation)({ summary: 'Demote admin to regular member' }),
|
|
1083
1081
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1084
1082
|
(0, swagger_1.ApiBody)({ type: dto_1.GroupMemberOperationDto }),
|
|
1083
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1085
1084
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1086
1085
|
__param(1, (0, common_1.Body)()),
|
|
1087
1086
|
__metadata("design:type", Function),
|
|
@@ -1092,6 +1091,8 @@ __decorate([
|
|
|
1092
1091
|
(0, common_1.Post)('group/unblock/:mobile'),
|
|
1093
1092
|
(0, swagger_1.ApiOperation)({ summary: 'Unblock a user in a group' }),
|
|
1094
1093
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1094
|
+
(0, swagger_1.ApiBody)({ schema: { type: 'object', properties: { groupId: { type: 'string' }, userId: { type: 'string' } } } }),
|
|
1095
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1095
1096
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1096
1097
|
__param(1, (0, common_1.Body)()),
|
|
1097
1098
|
__metadata("design:type", Function),
|
|
@@ -1103,6 +1104,7 @@ __decorate([
|
|
|
1103
1104
|
(0, swagger_1.ApiOperation)({ summary: 'Get list of group admins' }),
|
|
1104
1105
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1105
1106
|
(0, swagger_1.ApiQuery)({ name: 'groupId', description: 'Group ID', required: true }),
|
|
1107
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1106
1108
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1107
1109
|
__param(1, (0, common_1.Query)('groupId')),
|
|
1108
1110
|
__metadata("design:type", Function),
|
|
@@ -1114,6 +1116,7 @@ __decorate([
|
|
|
1114
1116
|
(0, swagger_1.ApiOperation)({ summary: 'Get list of banned users in a group' }),
|
|
1115
1117
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1116
1118
|
(0, swagger_1.ApiQuery)({ name: 'groupId', description: 'Group ID', required: true }),
|
|
1119
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1117
1120
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1118
1121
|
__param(1, (0, common_1.Query)('groupId')),
|
|
1119
1122
|
__metadata("design:type", Function),
|
|
@@ -1125,6 +1128,7 @@ __decorate([
|
|
|
1125
1128
|
(0, swagger_1.ApiOperation)({ summary: 'Export contacts in vCard or CSV format' }),
|
|
1126
1129
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1127
1130
|
(0, swagger_1.ApiBody)({ type: dto_1.ContactExportImportDto }),
|
|
1131
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1128
1132
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1129
1133
|
__param(1, (0, common_1.Body)()),
|
|
1130
1134
|
__param(2, (0, common_1.Res)()),
|
|
@@ -1136,6 +1140,8 @@ __decorate([
|
|
|
1136
1140
|
(0, common_1.Post)('contacts/import/:mobile'),
|
|
1137
1141
|
(0, swagger_1.ApiOperation)({ summary: 'Import contacts from a list' }),
|
|
1138
1142
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1143
|
+
(0, swagger_1.ApiBody)({ schema: { type: 'array', items: { type: 'object', properties: { firstName: { type: 'string' }, lastName: { type: 'string' }, phone: { type: 'string' } } } } }),
|
|
1144
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1139
1145
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1140
1146
|
__param(1, (0, common_1.Body)()),
|
|
1141
1147
|
__metadata("design:type", Function),
|
|
@@ -1147,6 +1153,7 @@ __decorate([
|
|
|
1147
1153
|
(0, swagger_1.ApiOperation)({ summary: 'Manage blocked contacts' }),
|
|
1148
1154
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1149
1155
|
(0, swagger_1.ApiBody)({ type: dto_1.ContactBlockListDto }),
|
|
1156
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1150
1157
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1151
1158
|
__param(1, (0, common_1.Body)()),
|
|
1152
1159
|
__metadata("design:type", Function),
|
|
@@ -1157,7 +1164,7 @@ __decorate([
|
|
|
1157
1164
|
(0, common_1.Get)('contacts/statistics/:mobile'),
|
|
1158
1165
|
(0, swagger_1.ApiOperation)({ summary: 'Get contact activity statistics' }),
|
|
1159
1166
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1160
|
-
(0, swagger_1.ApiResponse)({
|
|
1167
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1161
1168
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1162
1169
|
__metadata("design:type", Function),
|
|
1163
1170
|
__metadata("design:paramtypes", [String]),
|
|
@@ -1168,6 +1175,7 @@ __decorate([
|
|
|
1168
1175
|
(0, swagger_1.ApiOperation)({ summary: 'Create a new chat folder' }),
|
|
1169
1176
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1170
1177
|
(0, swagger_1.ApiBody)({ type: create_chat_folder_dto_1.CreateChatFolderDto }),
|
|
1178
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1171
1179
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1172
1180
|
__param(1, (0, common_1.Body)()),
|
|
1173
1181
|
__metadata("design:type", Function),
|
|
@@ -1178,6 +1186,7 @@ __decorate([
|
|
|
1178
1186
|
(0, common_1.Get)('folders/:mobile'),
|
|
1179
1187
|
(0, swagger_1.ApiOperation)({ summary: 'Get all chat folders' }),
|
|
1180
1188
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1189
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1181
1190
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1182
1191
|
__metadata("design:type", Function),
|
|
1183
1192
|
__metadata("design:paramtypes", [String]),
|
|
@@ -1187,6 +1196,8 @@ __decorate([
|
|
|
1187
1196
|
(0, common_1.Put)('messages/:mobile'),
|
|
1188
1197
|
(0, swagger_1.ApiOperation)({ summary: 'Edit message' }),
|
|
1189
1198
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1199
|
+
(0, swagger_1.ApiBody)({ schema: { type: 'object', properties: { chatId: { type: 'string' }, messageId: { type: 'number' }, text: { type: 'string' }, media: { type: 'object', properties: { type: { type: 'string', enum: ['photo', 'video', 'document'] }, url: { type: 'string' } } } } } }),
|
|
1200
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1190
1201
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1191
1202
|
__param(1, (0, common_1.Body)()),
|
|
1192
1203
|
__metadata("design:type", Function),
|
|
@@ -1197,6 +1208,8 @@ __decorate([
|
|
|
1197
1208
|
(0, common_1.Post)('chat/settings/:mobile'),
|
|
1198
1209
|
(0, swagger_1.ApiOperation)({ summary: 'Update chat settings' }),
|
|
1199
1210
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1211
|
+
(0, swagger_1.ApiBody)({ schema: { type: 'object', properties: { chatId: { type: 'string' }, title: { type: 'string' }, about: { type: 'string' }, photo: { type: 'string' }, slowMode: { type: 'number' }, linkedChat: { type: 'string' }, defaultSendAs: { type: 'string' }, username: { type: 'string' } } } }),
|
|
1212
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1200
1213
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1201
1214
|
__param(1, (0, common_1.Body)()),
|
|
1202
1215
|
__metadata("design:type", Function),
|
|
@@ -1207,6 +1220,8 @@ __decorate([
|
|
|
1207
1220
|
(0, common_1.Post)('media/batch/:mobile'),
|
|
1208
1221
|
(0, swagger_1.ApiOperation)({ summary: 'Send multiple media files in batch' }),
|
|
1209
1222
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1223
|
+
(0, swagger_1.ApiBody)({ schema: { type: 'object', properties: { chatId: { type: 'string' }, media: { type: 'array', items: { type: 'object', properties: { type: { type: 'string', enum: ['photo', 'video', 'document'] }, url: { type: 'string' }, caption: { type: 'string' }, fileName: { type: 'string' } } } }, silent: { type: 'boolean' }, scheduleDate: { type: 'number' } } } }),
|
|
1224
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1210
1225
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1211
1226
|
__param(1, (0, common_1.Body)()),
|
|
1212
1227
|
__metadata("design:type", Function),
|
|
@@ -1217,6 +1232,7 @@ __decorate([
|
|
|
1217
1232
|
(0, common_1.Get)('security/2fa-status/:mobile'),
|
|
1218
1233
|
(0, swagger_1.ApiOperation)({ summary: 'Check if 2FA password is set' }),
|
|
1219
1234
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1235
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1220
1236
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1221
1237
|
__metadata("design:type", Function),
|
|
1222
1238
|
__metadata("design:paramtypes", [String]),
|
|
@@ -1226,6 +1242,12 @@ __decorate([
|
|
|
1226
1242
|
(0, common_1.Get)('chats/:mobile'),
|
|
1227
1243
|
(0, swagger_1.ApiOperation)({ summary: 'Get chats with advanced filtering' }),
|
|
1228
1244
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1245
|
+
(0, swagger_1.ApiQuery)({ name: 'limit', required: false, type: Number }),
|
|
1246
|
+
(0, swagger_1.ApiQuery)({ name: 'offsetDate', required: false, type: Number }),
|
|
1247
|
+
(0, swagger_1.ApiQuery)({ name: 'offsetId', required: false, type: Number }),
|
|
1248
|
+
(0, swagger_1.ApiQuery)({ name: 'offsetPeer', required: false, type: String }),
|
|
1249
|
+
(0, swagger_1.ApiQuery)({ name: 'folderId', required: false, type: Number }),
|
|
1250
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1229
1251
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1230
1252
|
__param(1, (0, common_1.Query)('limit')),
|
|
1231
1253
|
__param(2, (0, common_1.Query)('offsetDate')),
|
|
@@ -1240,6 +1262,9 @@ __decorate([
|
|
|
1240
1262
|
(0, common_1.Get)('file/url/:mobile'),
|
|
1241
1263
|
(0, swagger_1.ApiOperation)({ summary: 'Get downloadable URL for a file' }),
|
|
1242
1264
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1265
|
+
(0, swagger_1.ApiQuery)({ name: 'url', required: true }),
|
|
1266
|
+
(0, swagger_1.ApiQuery)({ name: 'filename', required: true }),
|
|
1267
|
+
(0, swagger_1.ApiResponse)({ type: String }),
|
|
1243
1268
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1244
1269
|
__param(1, (0, common_1.Query)('url')),
|
|
1245
1270
|
__param(2, (0, common_1.Query)('filename')),
|
|
@@ -1251,6 +1276,8 @@ __decorate([
|
|
|
1251
1276
|
(0, common_1.Get)('messages/stats/:mobile'),
|
|
1252
1277
|
(0, swagger_1.ApiOperation)({ summary: 'Get message statistics' }),
|
|
1253
1278
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1279
|
+
(0, swagger_1.ApiBody)({ schema: { type: 'object', properties: { chatId: { type: 'string' }, period: { type: 'string', enum: ['day', 'week', 'month'] }, fromDate: { type: 'string', format: 'date-time' } } } }),
|
|
1280
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1254
1281
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1255
1282
|
__param(1, (0, common_1.Body)()),
|
|
1256
1283
|
__metadata("design:type", Function),
|
|
@@ -1261,6 +1288,7 @@ __decorate([
|
|
|
1261
1288
|
(0, common_1.Get)('chats/top-private/:mobile'),
|
|
1262
1289
|
(0, swagger_1.ApiOperation)({ summary: 'Get top 5 private chats with detailed statistics' }),
|
|
1263
1290
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1291
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1264
1292
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1265
1293
|
__metadata("design:type", Function),
|
|
1266
1294
|
__metadata("design:paramtypes", [String]),
|
|
@@ -1270,21 +1298,8 @@ __decorate([
|
|
|
1270
1298
|
(0, common_1.Post)('bots/add-to-channel/:mobile'),
|
|
1271
1299
|
(0, swagger_1.ApiOperation)({ summary: 'Add bots to channel with admin privileges' }),
|
|
1272
1300
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1273
|
-
(0, swagger_1.ApiBody)({
|
|
1274
|
-
|
|
1275
|
-
type: 'object',
|
|
1276
|
-
properties: {
|
|
1277
|
-
channelIds: {
|
|
1278
|
-
type: 'array',
|
|
1279
|
-
items: {
|
|
1280
|
-
type: 'string'
|
|
1281
|
-
},
|
|
1282
|
-
description: 'Array of channel IDs to add bots to. If not provided, will use default channels from environment variables.'
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
}),
|
|
1287
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'Bots added to channels successfully' }),
|
|
1301
|
+
(0, swagger_1.ApiBody)({ schema: { type: 'object', properties: { channelIds: { type: 'array', items: { type: 'string' }, description: 'Array of channel IDs to add bots to. If not provided, will use default channels from environment variables.' } } } }),
|
|
1302
|
+
(0, swagger_1.ApiResponse)({ type: Object }),
|
|
1288
1303
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1289
1304
|
__param(1, (0, common_1.Body)()),
|
|
1290
1305
|
__metadata("design:type", Function),
|
|
@@ -1296,19 +1311,7 @@ __decorate([
|
|
|
1296
1311
|
(0, swagger_1.ApiOperation)({ summary: 'Create a new bot using BotFather' }),
|
|
1297
1312
|
(0, swagger_1.ApiParam)({ name: 'mobile', description: 'Mobile number', required: true }),
|
|
1298
1313
|
(0, swagger_1.ApiBody)({ type: dto_1.CreateBotDto }),
|
|
1299
|
-
(0, swagger_1.ApiResponse)({
|
|
1300
|
-
status: 201,
|
|
1301
|
-
description: 'Bot created successfully',
|
|
1302
|
-
schema: {
|
|
1303
|
-
type: 'object',
|
|
1304
|
-
properties: {
|
|
1305
|
-
botToken: { type: 'string', description: 'The token to access HTTP Bot API' },
|
|
1306
|
-
username: { type: 'string', description: 'The username of the created bot' }
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
}),
|
|
1310
|
-
(0, swagger_1.ApiResponse)({ status: 400, description: 'Bad Request - Invalid bot details' }),
|
|
1311
|
-
(0, swagger_1.ApiResponse)({ status: 401, description: 'Unauthorized - Client not connected' }),
|
|
1314
|
+
(0, swagger_1.ApiResponse)({ type: Object, schema: { properties: { botToken: { type: 'string', description: 'The token to access HTTP Bot API' }, username: { type: 'string', description: 'The username of the created bot' } } } }),
|
|
1312
1315
|
__param(0, (0, common_1.Param)('mobile')),
|
|
1313
1316
|
__param(1, (0, common_1.Body)()),
|
|
1314
1317
|
__metadata("design:type", Function),
|