common-tg-service 1.3.114 → 1.3.115
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/buffer-clients/buffer-client.service.d.ts +23 -4
- package/dist/components/buffer-clients/buffer-client.service.js +242 -175
- package/dist/components/buffer-clients/buffer-client.service.js.map +1 -1
- package/dist/components/promote-clients/promote-client.service.d.ts +30 -2
- package/dist/components/promote-clients/promote-client.service.js +507 -411
- package/dist/components/promote-clients/promote-client.service.js.map +1 -1
- package/dist/components/shared/client-helper.utils.d.ts +6 -0
- package/dist/components/shared/client-helper.utils.js +32 -0
- package/dist/components/shared/client-helper.utils.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -39,7 +39,11 @@ export declare class BufferClientService implements OnModuleDestroy {
|
|
|
39
39
|
private readonly MAX_MAP_SIZE;
|
|
40
40
|
private readonly CLEANUP_INTERVAL;
|
|
41
41
|
private readonly MAX_NEW_BUFFER_CLIENTS_PER_TRIGGER;
|
|
42
|
-
private readonly
|
|
42
|
+
private readonly MIN_TOTAL_BUFFER_CLIENTS;
|
|
43
|
+
private readonly AVAILABILITY_WINDOWS;
|
|
44
|
+
private readonly ONE_DAY_MS;
|
|
45
|
+
private readonly THREE_MONTHS_MS;
|
|
46
|
+
private readonly INACTIVE_USER_CUTOFF_DAYS;
|
|
43
47
|
private cleanupIntervalId;
|
|
44
48
|
constructor(bufferClientModel: Model<BufferClientDocument>, telegramService: TelegramService, usersService: UsersService, activeChannelsService: ActiveChannelsService, clientService: ClientService, channelsService: ChannelsService, promoteClientService: PromoteClientService, sessionService: SessionService, botsService: BotsService);
|
|
45
49
|
onModuleDestroy(): Promise<void>;
|
|
@@ -79,9 +83,10 @@ export declare class BufferClientService implements OnModuleDestroy {
|
|
|
79
83
|
clearLeaveChannelInterval(): void;
|
|
80
84
|
setAsBufferClient(mobile: string, clientId: string, availableDate?: string): Promise<string>;
|
|
81
85
|
checkBufferClients(): Promise<void>;
|
|
82
|
-
private
|
|
83
|
-
private
|
|
86
|
+
private updateUser2FAStatus;
|
|
87
|
+
private calculateAvailabilityBasedNeeds;
|
|
84
88
|
private backfillTimestamps;
|
|
89
|
+
private performHealthCheck;
|
|
85
90
|
private getPendingUpdates;
|
|
86
91
|
private updatePrivacySettings;
|
|
87
92
|
private deleteProfilePhotos;
|
|
@@ -89,9 +94,23 @@ export declare class BufferClientService implements OnModuleDestroy {
|
|
|
89
94
|
private updateUsername;
|
|
90
95
|
private updateProfilePhotos;
|
|
91
96
|
processBufferClient(doc: BufferClient, client: Client): Promise<number>;
|
|
92
|
-
private calculateClientAssignments;
|
|
93
97
|
private createBufferClientFromUser;
|
|
94
98
|
addNewUserstoBufferClients(badIds: string[], goodIds: string[], clientsNeedingBufferClients?: string[], bufferClientsPerClient?: Map<string, number>): Promise<void>;
|
|
99
|
+
addNewUserstoBufferClientsDynamic(badIds: string[], goodIds: string[], clientsNeedingBufferClients: Array<{
|
|
100
|
+
clientId: string;
|
|
101
|
+
totalNeeded: number;
|
|
102
|
+
windowNeeds: Array<{
|
|
103
|
+
window: string;
|
|
104
|
+
available: number;
|
|
105
|
+
needed: number;
|
|
106
|
+
targetDate: string;
|
|
107
|
+
minRequired: number;
|
|
108
|
+
}>;
|
|
109
|
+
totalActive: number;
|
|
110
|
+
totalNeededForCount: number;
|
|
111
|
+
calculationReason: string;
|
|
112
|
+
priority: number;
|
|
113
|
+
}>, bufferClientsPerClient?: Map<string, number>): Promise<void>;
|
|
95
114
|
updateAllClientSessions(): Promise<void>;
|
|
96
115
|
getBufferClientsByClientId(clientId: string, status?: string): Promise<BufferClientDocument[]>;
|
|
97
116
|
getBufferClientDistribution(): Promise<{
|