@kaikybrofc/omnizap-system 2.3.2 → 2.3.3
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/README.md +79 -482
- package/app/modules/stickerModule/stickerCommand.js +7 -2
- package/app/modules/stickerModule/stickerTextCommand.js +7 -2
- package/app/modules/stickerPackModule/stickerPackCommandHandlers.js +224 -53
- package/app/services/lidMapService.js +83 -4
- package/package.json +1 -1
- package/public/js/apps/createPackApp.js +4 -4
- package/public/js/apps/homeApp.js +4 -5
- package/public/js/apps/loginApp.js +83 -28
- package/public/js/apps/stickersAdminApp.js +1 -1
- package/public/js/apps/stickersApp.js +1 -1
- package/public/js/apps/userApp.js +8 -37
- package/public/login/index.html +17 -11
- package/public/user/index.html +0 -1
- package/server/controllers/stickerCatalog/nonCatalogHandlers.js +1 -26
- package/server/controllers/stickerCatalogController.js +161 -63
- package/server/middleware/cachePolicyHelpers.js +1 -2
- package/server/middleware/rateLimit.js +9 -2
- package/server/routes/indexRouter.js +1 -7
|
@@ -6,17 +6,18 @@ const LOGIN_CONSENT_STORAGE_KEY = 'omnizap_login_terms_consent_v1';
|
|
|
6
6
|
const LOGIN_CONSENT_HINT = 'Aceite os Termos de Uso e a Politica de Privacidade para continuar.';
|
|
7
7
|
const DEFAULT_SUCCESS_CHAT_LABEL = 'Abrir WhatsApp do bot';
|
|
8
8
|
const DEFAULT_SUCCESS_HOME_LABEL = 'Ir para o painel';
|
|
9
|
-
const ALREADY_LOGGED_STATUS_TEXT = 'Voce ja esta logado neste navegador.';
|
|
10
9
|
const ALREADY_LOGGED_HINT_TEXT = 'Nao e necessario fazer login novamente. Escolha uma opcao abaixo.';
|
|
11
10
|
|
|
12
11
|
const root = document.getElementById('login-app-root');
|
|
13
12
|
|
|
14
13
|
if (root) {
|
|
15
14
|
const ui = {
|
|
15
|
+
loginCard: document.getElementById('login-main-card'),
|
|
16
16
|
status: document.getElementById('login-status'),
|
|
17
17
|
hint: document.getElementById('login-hint'),
|
|
18
18
|
error: document.getElementById('login-error'),
|
|
19
19
|
googleArea: document.getElementById('google-login-area'),
|
|
20
|
+
googleButtonShell: document.getElementById('google-login-button-shell'),
|
|
20
21
|
googleButton: document.querySelector('[data-google-login-button]'),
|
|
21
22
|
googleState: document.getElementById('google-login-state'),
|
|
22
23
|
consentBox: document.getElementById('login-consent-box'),
|
|
@@ -59,6 +60,25 @@ if (root) {
|
|
|
59
60
|
element.textContent = String(value || '');
|
|
60
61
|
};
|
|
61
62
|
|
|
63
|
+
const isAuthenticatedFlagEnabled = (value) => {
|
|
64
|
+
if (value === true || value === 1) return true;
|
|
65
|
+
if (typeof value === 'string') {
|
|
66
|
+
const normalized = value.trim().toLowerCase();
|
|
67
|
+
return normalized === 'true' || normalized === '1';
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const isAuthenticatedGoogleSession = (sessionData) => {
|
|
73
|
+
if (!sessionData || typeof sessionData !== 'object') return false;
|
|
74
|
+
if (!isAuthenticatedFlagEnabled(sessionData.authenticated)) return false;
|
|
75
|
+
const provider = String(sessionData.provider || '').trim().toLowerCase();
|
|
76
|
+
if (provider && provider !== 'google') return false;
|
|
77
|
+
const ownerJid = String(sessionData.owner_jid || '').trim();
|
|
78
|
+
const userSub = String(sessionData?.user?.sub || '').trim();
|
|
79
|
+
return Boolean(ownerJid || userSub);
|
|
80
|
+
};
|
|
81
|
+
|
|
62
82
|
const normalizeDigits = (value) => String(value || '').replace(/\D+/g, '');
|
|
63
83
|
|
|
64
84
|
const showError = (message) => {
|
|
@@ -82,7 +102,9 @@ if (root) {
|
|
|
82
102
|
} else {
|
|
83
103
|
window.localStorage.removeItem(LOGIN_CONSENT_STORAGE_KEY);
|
|
84
104
|
}
|
|
85
|
-
} catch {
|
|
105
|
+
} catch {
|
|
106
|
+
// Ignore storage errors (private mode or blocked storage).
|
|
107
|
+
}
|
|
86
108
|
};
|
|
87
109
|
|
|
88
110
|
const readConsentState = () => {
|
|
@@ -131,6 +153,47 @@ if (root) {
|
|
|
131
153
|
setText(ui.googleState, state.busy ? 'Finalizando login...' : state.consentAccepted ? (state.googleReady ? '' : 'Carregando login Google...') : LOGIN_CONSENT_HINT);
|
|
132
154
|
};
|
|
133
155
|
|
|
156
|
+
const renderGoogleLoginControls = () => {
|
|
157
|
+
const hideLoginControls = state.authenticated;
|
|
158
|
+
if (ui.consentBox) {
|
|
159
|
+
ui.consentBox.hidden = hideLoginControls;
|
|
160
|
+
}
|
|
161
|
+
if (ui.googleButtonShell) {
|
|
162
|
+
ui.googleButtonShell.hidden = hideLoginControls || !state.consentAccepted;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const renderLoginCardVisibility = () => {
|
|
167
|
+
if (!ui.loginCard) return;
|
|
168
|
+
ui.loginCard.hidden = Boolean(state.authenticated);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const resolveGoogleButtonWidth = () => {
|
|
172
|
+
const directWidth = Math.floor(Number(ui.googleButton?.clientWidth || 0));
|
|
173
|
+
if (directWidth > 0) {
|
|
174
|
+
return Math.max(180, Math.min(320, directWidth));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const areaWidth = Math.floor(Number(ui.googleArea?.clientWidth || 0));
|
|
178
|
+
if (areaWidth > 0) {
|
|
179
|
+
const areaStyles = ui.googleArea ? window.getComputedStyle(ui.googleArea) : null;
|
|
180
|
+
const shellStyles = ui.googleButtonShell ? window.getComputedStyle(ui.googleButtonShell) : null;
|
|
181
|
+
const areaPaddingX = areaStyles ? Number.parseFloat(areaStyles.paddingLeft || '0') + Number.parseFloat(areaStyles.paddingRight || '0') : 0;
|
|
182
|
+
const shellPaddingX = shellStyles ? Number.parseFloat(shellStyles.paddingLeft || '0') + Number.parseFloat(shellStyles.paddingRight || '0') : 16;
|
|
183
|
+
const shellBorderX = shellStyles ? Number.parseFloat(shellStyles.borderLeftWidth || '0') + Number.parseFloat(shellStyles.borderRightWidth || '0') : 2;
|
|
184
|
+
const available = Math.floor(areaWidth - areaPaddingX - shellPaddingX - shellBorderX);
|
|
185
|
+
if (available > 0) {
|
|
186
|
+
return Math.max(180, Math.min(320, available));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const viewportAvailable = Math.floor(Number(window.innerWidth || 0)) - 96;
|
|
191
|
+
if (viewportAvailable > 0) {
|
|
192
|
+
return Math.max(180, Math.min(320, viewportAvailable));
|
|
193
|
+
}
|
|
194
|
+
return 280;
|
|
195
|
+
};
|
|
196
|
+
|
|
134
197
|
const formatPhone = (digits) => {
|
|
135
198
|
const value = normalizeDigits(digits);
|
|
136
199
|
if (!value) return '';
|
|
@@ -174,7 +237,7 @@ if (root) {
|
|
|
174
237
|
|
|
175
238
|
const renderSuccessActions = (sessionData, options = {}) => {
|
|
176
239
|
if (!ui.successActions) return;
|
|
177
|
-
const authenticated =
|
|
240
|
+
const authenticated = isAuthenticatedFlagEnabled(sessionData?.authenticated);
|
|
178
241
|
ui.successActions.hidden = !authenticated;
|
|
179
242
|
if (!authenticated) return;
|
|
180
243
|
|
|
@@ -209,28 +272,10 @@ if (root) {
|
|
|
209
272
|
state.authenticated = true;
|
|
210
273
|
state.sessionOwnerPhone = ownerPhone;
|
|
211
274
|
|
|
212
|
-
setText(ui.status, ALREADY_LOGGED_STATUS_TEXT);
|
|
213
|
-
if (ownerPhone) {
|
|
214
|
-
setText(ui.hint, `Sessao ativa para +${formatPhone(ownerPhone)}.`);
|
|
215
|
-
} else {
|
|
216
|
-
setText(ui.hint, ALREADY_LOGGED_HINT_TEXT);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
275
|
showError('');
|
|
220
276
|
showConsentError('');
|
|
221
|
-
renderAlreadyLoggedBanner({ visible: true, ownerPhone });
|
|
222
277
|
hideSuccessCelebration();
|
|
223
|
-
|
|
224
|
-
if (ui.summary) ui.summary.hidden = true;
|
|
225
|
-
if (ui.whatsappCta) ui.whatsappCta.hidden = true;
|
|
226
|
-
renderSuccessActions(
|
|
227
|
-
{ authenticated: true },
|
|
228
|
-
{
|
|
229
|
-
chatLabel: 'Abrir WPP no bot',
|
|
230
|
-
homeLabel: 'Voltar para tela inicial',
|
|
231
|
-
homeHref: '/',
|
|
232
|
-
},
|
|
233
|
-
);
|
|
278
|
+
renderSessionSummary(sessionData);
|
|
234
279
|
};
|
|
235
280
|
|
|
236
281
|
const renderWhatsAppCta = () => {
|
|
@@ -280,14 +325,18 @@ if (root) {
|
|
|
280
325
|
if (!canUseGoogleLogin()) {
|
|
281
326
|
state.authenticated = false;
|
|
282
327
|
state.sessionOwnerPhone = '';
|
|
328
|
+
renderGoogleLoginControls();
|
|
329
|
+
renderLoginCardVisibility();
|
|
283
330
|
if (ui.summary) ui.summary.hidden = true;
|
|
284
331
|
renderSuccessActions(null);
|
|
285
332
|
renderWhatsAppCta();
|
|
286
333
|
return;
|
|
287
334
|
}
|
|
288
335
|
|
|
289
|
-
const authenticated =
|
|
336
|
+
const authenticated = isAuthenticatedGoogleSession(sessionData);
|
|
290
337
|
state.authenticated = authenticated;
|
|
338
|
+
renderGoogleLoginControls();
|
|
339
|
+
renderLoginCardVisibility();
|
|
291
340
|
renderSuccessActions(sessionData);
|
|
292
341
|
if (ui.summary) ui.summary.hidden = !authenticated;
|
|
293
342
|
if (!authenticated) {
|
|
@@ -364,6 +413,7 @@ if (root) {
|
|
|
364
413
|
if (state.consentAccepted) {
|
|
365
414
|
showConsentError('');
|
|
366
415
|
}
|
|
416
|
+
renderGoogleLoginControls();
|
|
367
417
|
setBusy(state.busy);
|
|
368
418
|
};
|
|
369
419
|
|
|
@@ -391,7 +441,7 @@ if (root) {
|
|
|
391
441
|
body: JSON.stringify(buildSessionPayload(token)),
|
|
392
442
|
});
|
|
393
443
|
const sessionData = sessionPayload?.data || {};
|
|
394
|
-
if (!sessionData
|
|
444
|
+
if (!isAuthenticatedGoogleSession(sessionData)) {
|
|
395
445
|
throw new Error('Nao foi possivel criar a sessao Google.');
|
|
396
446
|
}
|
|
397
447
|
setText(ui.status, 'Conta Google detectada');
|
|
@@ -454,8 +504,7 @@ if (root) {
|
|
|
454
504
|
});
|
|
455
505
|
|
|
456
506
|
ui.googleButton.innerHTML = '';
|
|
457
|
-
const
|
|
458
|
-
const buttonWidth = Math.max(180, Math.min(320, measuredWidth || 320));
|
|
507
|
+
const buttonWidth = resolveGoogleButtonWidth();
|
|
459
508
|
accounts.renderButton(ui.googleButton, {
|
|
460
509
|
type: 'standard',
|
|
461
510
|
theme: 'outline',
|
|
@@ -529,7 +578,7 @@ if (root) {
|
|
|
529
578
|
try {
|
|
530
579
|
const payload = await fetchJson(sessionApiPath, { method: 'GET' });
|
|
531
580
|
const sessionData = payload?.data || {};
|
|
532
|
-
if (sessionData
|
|
581
|
+
if (isAuthenticatedGoogleSession(sessionData)) {
|
|
533
582
|
renderAlreadyLoggedInState(sessionData);
|
|
534
583
|
return true;
|
|
535
584
|
}
|
|
@@ -554,6 +603,7 @@ if (root) {
|
|
|
554
603
|
if (ui.googleArea) {
|
|
555
604
|
ui.googleArea.hidden = !allowed;
|
|
556
605
|
}
|
|
606
|
+
renderGoogleLoginControls();
|
|
557
607
|
if (!allowed) {
|
|
558
608
|
renderAlreadyLoggedBanner({ visible: false });
|
|
559
609
|
}
|
|
@@ -568,6 +618,7 @@ if (root) {
|
|
|
568
618
|
};
|
|
569
619
|
|
|
570
620
|
const init = async () => {
|
|
621
|
+
renderAlreadyLoggedBanner({ visible: false });
|
|
571
622
|
if (ui.consentCheckbox) {
|
|
572
623
|
ui.consentCheckbox.checked = readConsentState();
|
|
573
624
|
ui.consentCheckbox.addEventListener('change', syncConsentState);
|
|
@@ -581,8 +632,12 @@ if (root) {
|
|
|
581
632
|
renderSuccessActions(null);
|
|
582
633
|
const allowGoogleLogin = renderGoogleLoginGate();
|
|
583
634
|
await loadBotPhone();
|
|
635
|
+
if (!allowGoogleLogin) {
|
|
636
|
+
renderSessionSummary(null);
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
584
639
|
const alreadyLogged = await loadCurrentSession();
|
|
585
|
-
if (alreadyLogged
|
|
640
|
+
if (alreadyLogged) return;
|
|
586
641
|
await loadConfig();
|
|
587
642
|
await mountGoogleButton();
|
|
588
643
|
};
|
|
@@ -2293,7 +2293,7 @@ function StickersApp() {
|
|
|
2293
2293
|
let attempt = 0;
|
|
2294
2294
|
while (true) {
|
|
2295
2295
|
try {
|
|
2296
|
-
const response = await fetch(url, { credentials: '
|
|
2296
|
+
const response = await fetch(url, { credentials: 'include', ...opts });
|
|
2297
2297
|
const rawText = await response.text().catch(() => '');
|
|
2298
2298
|
let payload = {};
|
|
2299
2299
|
if (rawText) {
|
|
@@ -640,10 +640,7 @@ if (root) {
|
|
|
640
640
|
const severity = normalizeString(event?.severity) || 'low';
|
|
641
641
|
const badgeLabel = severity.toUpperCase();
|
|
642
642
|
const createdAt = formatDateTime(event?.created_at || event?.revoked_at);
|
|
643
|
-
const meta = [
|
|
644
|
-
normalizeString(event?.subtitle),
|
|
645
|
-
`Tipo: ${normalizeString(event?.event_type) || 'evento'} • ${createdAt}`,
|
|
646
|
-
];
|
|
643
|
+
const meta = [normalizeString(event?.subtitle), `Tipo: ${normalizeString(event?.event_type) || 'evento'} • ${createdAt}`];
|
|
647
644
|
|
|
648
645
|
if (normalizeString(event?.reason)) meta.push(`Motivo: ${normalizeString(event.reason)}`);
|
|
649
646
|
|
|
@@ -691,11 +688,7 @@ if (root) {
|
|
|
691
688
|
for (const session of list) {
|
|
692
689
|
const identity = compactIdentityPayload(session);
|
|
693
690
|
const title = normalizeString(session?.name || session?.email || session?.owner_jid || 'Sessão ativa');
|
|
694
|
-
const meta = [
|
|
695
|
-
`Email: ${normalizeString(session?.email) || 'n/d'}`,
|
|
696
|
-
`Owner: ${normalizeString(session?.owner_jid) || 'n/d'}`,
|
|
697
|
-
`Último acesso: ${formatDateTime(session?.last_seen_at)} • Expira: ${formatDateTime(session?.expires_at)}`,
|
|
698
|
-
];
|
|
691
|
+
const meta = [`Email: ${normalizeString(session?.email) || 'n/d'}`, `Owner: ${normalizeString(session?.owner_jid) || 'n/d'}`, `Último acesso: ${formatDateTime(session?.last_seen_at)} • Expira: ${formatDateTime(session?.expires_at)}`];
|
|
699
692
|
const actions = [];
|
|
700
693
|
if (Object.keys(identity).length) {
|
|
701
694
|
actions.push(createMiniButton('Forçar logout', () => handleAdminForceLogout(identity, buildIdentityLabel(identity))));
|
|
@@ -723,11 +716,7 @@ if (root) {
|
|
|
723
716
|
for (const user of list) {
|
|
724
717
|
const identity = buildForceLogoutPayloadFromAny(user);
|
|
725
718
|
const title = normalizeString(user?.name || user?.email || user?.owner_jid || 'Usuário');
|
|
726
|
-
const meta = [
|
|
727
|
-
`Email: ${normalizeString(user?.email) || 'n/d'}`,
|
|
728
|
-
`Owner: ${normalizeString(user?.owner_jid) || 'n/d'}`,
|
|
729
|
-
`Último login: ${formatDateTime(user?.last_login_at)} • Último acesso: ${formatDateTime(user?.last_seen_at)}`,
|
|
730
|
-
];
|
|
719
|
+
const meta = [`Email: ${normalizeString(user?.email) || 'n/d'}`, `Owner: ${normalizeString(user?.owner_jid) || 'n/d'}`, `Último login: ${formatDateTime(user?.last_login_at)} • Último acesso: ${formatDateTime(user?.last_seen_at)}`];
|
|
731
720
|
const actions = [];
|
|
732
721
|
if (Object.keys(identity).length) {
|
|
733
722
|
actions.push(createMiniButton('Forçar logout', () => handleAdminForceLogout(identity, buildIdentityLabel(identity))));
|
|
@@ -755,10 +744,7 @@ if (root) {
|
|
|
755
744
|
for (const ban of list) {
|
|
756
745
|
const identity = normalizeString(ban?.email || ban?.owner_jid || ban?.google_sub || `ban:${ban?.id || ''}`);
|
|
757
746
|
const isRevoked = Boolean(ban?.revoked_at);
|
|
758
|
-
const meta = [
|
|
759
|
-
`Criado: ${formatDateTime(ban?.created_at)}${isRevoked ? ` • Revogado: ${formatDateTime(ban?.revoked_at)}` : ''}`,
|
|
760
|
-
`Motivo: ${normalizeString(ban?.reason) || 'não informado'}`,
|
|
761
|
-
];
|
|
747
|
+
const meta = [`Criado: ${formatDateTime(ban?.created_at)}${isRevoked ? ` • Revogado: ${formatDateTime(ban?.revoked_at)}` : ''}`, `Motivo: ${normalizeString(ban?.reason) || 'não informado'}`];
|
|
762
748
|
const actions = [];
|
|
763
749
|
if (!isRevoked && normalizeString(ban?.id)) {
|
|
764
750
|
actions.push(createMiniButton('Revogar ban', () => handleAdminBanRevoke(ban.id)));
|
|
@@ -791,10 +777,7 @@ if (root) {
|
|
|
791
777
|
const details = isObject(item?.details) ? Object.entries(item.details).slice(0, 3) : [];
|
|
792
778
|
const detailLine = details.length ? `Detalhes: ${details.map(([key, value]) => `${key}=${value}`).join(' • ')}` : '';
|
|
793
779
|
|
|
794
|
-
const meta = [
|
|
795
|
-
`Admin: ${normalizeString(item?.admin_email || item?.admin_google_sub || item?.admin_owner_jid || 'n/d')} (${formatAdminRole(normalizeString(item?.admin_role || 'admin'))})`,
|
|
796
|
-
`Alvo: ${targetType}${targetId ? ` / ${targetId}` : ''} • Em: ${formatDateTime(item?.created_at)}`,
|
|
797
|
-
];
|
|
780
|
+
const meta = [`Admin: ${normalizeString(item?.admin_email || item?.admin_google_sub || item?.admin_owner_jid || 'n/d')} (${formatAdminRole(normalizeString(item?.admin_role || 'admin'))})`, `Alvo: ${targetType}${targetId ? ` / ${targetId}` : ''} • Em: ${formatDateTime(item?.created_at)}`];
|
|
798
781
|
if (detailLine) meta.push(detailLine);
|
|
799
782
|
|
|
800
783
|
appendListItem({
|
|
@@ -868,11 +851,7 @@ if (root) {
|
|
|
868
851
|
title: flagName || 'feature_flag',
|
|
869
852
|
severity: isEnabled ? 'low' : 'medium',
|
|
870
853
|
badgeLabel: isEnabled ? 'ON' : 'OFF',
|
|
871
|
-
meta: [
|
|
872
|
-
`Rollout: ${rollout}%`,
|
|
873
|
-
description ? `Descrição: ${description}` : 'Descrição: n/d',
|
|
874
|
-
`Atualizado por: ${updatedBy || 'n/d'} • ${formatDateTime(flag?.updated_at)}`,
|
|
875
|
-
],
|
|
854
|
+
meta: [`Rollout: ${rollout}%`, description ? `Descrição: ${description}` : 'Descrição: n/d', `Atualizado por: ${updatedBy || 'n/d'} • ${formatDateTime(flag?.updated_at)}`],
|
|
876
855
|
actions,
|
|
877
856
|
customNode: rolloutForm,
|
|
878
857
|
});
|
|
@@ -891,10 +870,7 @@ if (root) {
|
|
|
891
870
|
for (const alert of list) {
|
|
892
871
|
const severity = normalizeString(alert?.severity || 'low');
|
|
893
872
|
const title = normalizeString(alert?.title || alert?.code || 'Alerta');
|
|
894
|
-
const meta = [
|
|
895
|
-
normalizeString(alert?.message || ''),
|
|
896
|
-
`Código: ${normalizeString(alert?.code || 'n/d')} • ${formatDateTime(alert?.created_at)}`,
|
|
897
|
-
];
|
|
873
|
+
const meta = [normalizeString(alert?.message || ''), `Código: ${normalizeString(alert?.code || 'n/d')} • ${formatDateTime(alert?.created_at)}`];
|
|
898
874
|
appendListItem({
|
|
899
875
|
container: ui.adminAlertsList,
|
|
900
876
|
title,
|
|
@@ -923,12 +899,7 @@ if (root) {
|
|
|
923
899
|
title: `Resultado para "${q || 'consulta'}"`,
|
|
924
900
|
severity: 'low',
|
|
925
901
|
badgeLabel: 'BUSCA',
|
|
926
|
-
meta: [
|
|
927
|
-
`Usuários: ${formatIntegerOrNd(totals.users)}`,
|
|
928
|
-
`Sessões: ${formatIntegerOrNd(totals.sessions)}`,
|
|
929
|
-
`Grupos: ${formatIntegerOrNd(totals.groups)}`,
|
|
930
|
-
`Packs: ${formatIntegerOrNd(totals.packs)}`,
|
|
931
|
-
],
|
|
902
|
+
meta: [`Usuários: ${formatIntegerOrNd(totals.users)}`, `Sessões: ${formatIntegerOrNd(totals.sessions)}`, `Grupos: ${formatIntegerOrNd(totals.groups)}`, `Packs: ${formatIntegerOrNd(totals.packs)}`],
|
|
932
903
|
});
|
|
933
904
|
|
|
934
905
|
const users = Array.isArray(results.users) ? results.users : [];
|
package/public/login/index.html
CHANGED
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
box-sizing: border-box;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
[hidden] {
|
|
44
|
+
display: none !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
html,
|
|
44
48
|
body {
|
|
45
49
|
margin: 0;
|
|
@@ -50,10 +54,7 @@
|
|
|
50
54
|
body {
|
|
51
55
|
color: var(--text);
|
|
52
56
|
font-family: 'Manrope', system-ui, sans-serif;
|
|
53
|
-
background:
|
|
54
|
-
radial-gradient(56rem 25rem at -8% -16%, #2563eb2f, transparent 62%),
|
|
55
|
-
radial-gradient(54rem 22rem at 108% -8%, #22c55e1f, transparent 60%),
|
|
56
|
-
linear-gradient(165deg, var(--bg), var(--bg-2));
|
|
57
|
+
background: radial-gradient(56rem 25rem at -8% -16%, #2563eb2f, transparent 62%), radial-gradient(54rem 22rem at 108% -8%, #22c55e1f, transparent 60%), linear-gradient(165deg, var(--bg), var(--bg-2));
|
|
57
58
|
min-height: 100vh;
|
|
58
59
|
display: flex;
|
|
59
60
|
align-items: center;
|
|
@@ -280,6 +281,7 @@
|
|
|
280
281
|
border-radius: 14px;
|
|
281
282
|
background: #ffffff;
|
|
282
283
|
padding: 8px;
|
|
284
|
+
overflow: hidden;
|
|
283
285
|
box-shadow:
|
|
284
286
|
0 8px 18px #02091624,
|
|
285
287
|
inset 0 1px 0 #ffffff;
|
|
@@ -297,7 +299,14 @@
|
|
|
297
299
|
|
|
298
300
|
[data-google-login-button] {
|
|
299
301
|
width: 100%;
|
|
302
|
+
max-width: 100%;
|
|
300
303
|
min-height: 44px;
|
|
304
|
+
overflow: hidden;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
[data-google-login-button] > div,
|
|
308
|
+
[data-google-login-button] iframe {
|
|
309
|
+
max-width: 100% !important;
|
|
301
310
|
}
|
|
302
311
|
|
|
303
312
|
.google-state {
|
|
@@ -595,7 +604,7 @@
|
|
|
595
604
|
<h1>Acesse sua conta</h1>
|
|
596
605
|
<p class="lead">Vincule seu WhatsApp e libere os recursos do OmniZap.</p>
|
|
597
606
|
|
|
598
|
-
<article class="card">
|
|
607
|
+
<article id="login-main-card" class="card">
|
|
599
608
|
<p id="login-status" class="status">Verificando conta Google...</p>
|
|
600
609
|
<p id="login-hint" class="hint"></p>
|
|
601
610
|
<p id="login-error" class="error" hidden></p>
|
|
@@ -605,17 +614,14 @@
|
|
|
605
614
|
</div>
|
|
606
615
|
|
|
607
616
|
<div id="google-login-area" class="google-area" hidden>
|
|
608
|
-
<div class="google-button-shell">
|
|
617
|
+
<div id="google-login-button-shell" class="google-button-shell" hidden>
|
|
609
618
|
<div data-google-login-button></div>
|
|
610
619
|
</div>
|
|
611
620
|
<p id="google-login-state" class="google-state">Carregando login Google...</p>
|
|
612
621
|
<div id="login-consent-box" class="consent">
|
|
613
622
|
<label class="consent-row" for="login-consent-checkbox">
|
|
614
623
|
<input id="login-consent-checkbox" type="checkbox" />
|
|
615
|
-
<span>
|
|
616
|
-
Li e aceito os <a href="/termos-de-uso/" target="_blank" rel="noreferrer noopener">Termos de Uso</a> e a
|
|
617
|
-
<a href="/termos-de-uso/#politica-de-privacidade" target="_blank" rel="noreferrer noopener">Politica de Privacidade</a>.
|
|
618
|
-
</span>
|
|
624
|
+
<span> Li e aceito os <a href="/termos-de-uso/" target="_blank" rel="noreferrer noopener">Termos de Uso</a> e a <a href="/termos-de-uso/#politica-de-privacidade" target="_blank" rel="noreferrer noopener">Politica de Privacidade</a>. </span>
|
|
619
625
|
</label>
|
|
620
626
|
<p id="login-consent-error" class="consent-error" hidden></p>
|
|
621
627
|
</div>
|
|
@@ -652,6 +658,6 @@
|
|
|
652
658
|
</div>
|
|
653
659
|
</div>
|
|
654
660
|
|
|
655
|
-
<script type="module" src="/js/apps/loginApp.js?v=
|
|
661
|
+
<script type="module" src="/js/apps/loginApp.js?v=20260301j"></script>
|
|
656
662
|
</body>
|
|
657
663
|
</html>
|
package/public/user/index.html
CHANGED
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
export const createStickerCatalogNonCatalogHandlers = ({
|
|
2
|
-
sendJson,
|
|
3
|
-
sendText,
|
|
4
|
-
logger,
|
|
5
|
-
getSystemSummaryCached,
|
|
6
|
-
systemSummaryCache,
|
|
7
|
-
systemSummaryCacheSeconds,
|
|
8
|
-
getReadmeSummaryCached,
|
|
9
|
-
readmeSummaryCache,
|
|
10
|
-
readmeSummaryCacheSeconds,
|
|
11
|
-
getGlobalRankingSummaryCached,
|
|
12
|
-
globalRankRefreshSeconds,
|
|
13
|
-
globalRankCache,
|
|
14
|
-
sanitizeRankingPayloadByBot,
|
|
15
|
-
getActiveSocket,
|
|
16
|
-
resolveBotUserCandidates,
|
|
17
|
-
getMarketplaceGlobalStatsCached,
|
|
18
|
-
marketplaceGlobalStatsCacheSeconds,
|
|
19
|
-
marketplaceGlobalStatsCache,
|
|
20
|
-
githubRepoInfo,
|
|
21
|
-
githubToken,
|
|
22
|
-
githubProjectCacheSeconds,
|
|
23
|
-
fetchGitHubProjectSummary,
|
|
24
|
-
buildSupportInfo,
|
|
25
|
-
buildBotContactInfo,
|
|
26
|
-
}) => {
|
|
1
|
+
export const createStickerCatalogNonCatalogHandlers = ({ sendJson, sendText, logger, getSystemSummaryCached, systemSummaryCache, systemSummaryCacheSeconds, getReadmeSummaryCached, readmeSummaryCache, readmeSummaryCacheSeconds, getGlobalRankingSummaryCached, globalRankRefreshSeconds, globalRankCache, sanitizeRankingPayloadByBot, getActiveSocket, resolveBotUserCandidates, getMarketplaceGlobalStatsCached, marketplaceGlobalStatsCacheSeconds, marketplaceGlobalStatsCache, githubRepoInfo, githubToken, githubProjectCacheSeconds, fetchGitHubProjectSummary, buildSupportInfo, buildBotContactInfo }) => {
|
|
27
2
|
const handleSystemSummaryRequest = async (req, res) => {
|
|
28
3
|
try {
|
|
29
4
|
const payload = await getSystemSummaryCached();
|