@trendify/cli 0.1.6 → 0.1.8
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 +26 -0
- package/dist/app.component.d.ts +14 -0
- package/dist/app.component.d.ts.map +1 -0
- package/dist/app.component.js +448 -0
- package/dist/app.d.ts +9 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +84 -27
- package/dist/cli-update-service.d.ts +29 -0
- package/dist/cli-update-service.d.ts.map +1 -0
- package/dist/cli-update-service.js +206 -0
- package/dist/cli.entry.d.ts +3 -0
- package/dist/cli.entry.d.ts.map +1 -0
- package/dist/cli.entry.js +51 -0
- package/dist/cli.js +24 -1
- package/dist/modules/auth/pages/login.page.d.ts +12 -0
- package/dist/modules/auth/pages/login.page.d.ts.map +1 -0
- package/dist/modules/auth/pages/login.page.js +22 -0
- package/dist/modules/auth/pages/profile.page.d.ts +12 -0
- package/dist/modules/auth/pages/profile.page.d.ts.map +1 -0
- package/dist/modules/auth/pages/profile.page.js +180 -0
- package/dist/modules/auth/services/auth-storage.service.d.ts +11 -0
- package/dist/modules/auth/services/auth-storage.service.d.ts.map +1 -0
- package/dist/modules/auth/services/auth-storage.service.js +65 -0
- package/dist/modules/auth/services/auth.service.d.ts +60 -0
- package/dist/modules/auth/services/auth.service.d.ts.map +1 -0
- package/dist/modules/auth/services/auth.service.js +494 -0
- package/dist/modules/auth/utils/auth-user.util.d.ts +3 -0
- package/dist/modules/auth/utils/auth-user.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/auth-user.util.js +10 -0
- package/dist/modules/discovery/components/discovery-step-header.component.d.ts +7 -0
- package/dist/modules/discovery/components/discovery-step-header.component.d.ts.map +1 -0
- package/dist/modules/discovery/components/discovery-step-header.component.js +5 -0
- package/dist/modules/discovery/pages/discovery.page.d.ts +11 -0
- package/dist/modules/discovery/pages/discovery.page.d.ts.map +1 -0
- package/dist/modules/discovery/pages/discovery.page.js +58 -0
- package/dist/modules/profile/pages/profile.page.d.ts +12 -0
- package/dist/modules/profile/pages/profile.page.d.ts.map +1 -0
- package/dist/modules/profile/pages/profile.page.js +180 -0
- package/dist/shared/components/action-menu.component.d.ts +13 -0
- package/dist/shared/components/action-menu.component.d.ts.map +1 -0
- package/dist/shared/components/action-menu.component.js +7 -0
- package/dist/shared/components/app-logo.component.d.ts +2 -0
- package/dist/shared/components/app-logo.component.d.ts.map +1 -0
- package/dist/shared/components/app-logo.component.js +13 -0
- package/dist/shared/components/app-menu.component.d.ts +17 -0
- package/dist/shared/components/app-menu.component.d.ts.map +1 -0
- package/dist/shared/components/app-menu.component.js +85 -0
- package/dist/shared/components/app-shell.component.d.ts +12 -0
- package/dist/shared/components/app-shell.component.d.ts.map +1 -0
- package/dist/shared/components/app-shell.component.js +15 -0
- package/dist/shared/components/radio-select.component.d.ts +12 -0
- package/dist/shared/components/radio-select.component.d.ts.map +1 -0
- package/dist/shared/components/radio-select.component.js +16 -0
- package/dist/shared/components/step-header.component.d.ts +7 -0
- package/dist/shared/components/step-header.component.d.ts.map +1 -0
- package/dist/shared/components/step-header.component.js +5 -0
- package/dist/shared/components/text-field.component.d.ts +12 -0
- package/dist/shared/components/text-field.component.d.ts.map +1 -0
- package/dist/shared/components/text-field.component.js +6 -0
- package/dist/shared/config/app-paths.config.d.ts +4 -0
- package/dist/shared/config/app-paths.config.d.ts.map +1 -0
- package/dist/shared/config/app-paths.config.js +5 -0
- package/dist/shared/config/env.config.d.ts +14 -0
- package/dist/shared/config/env.config.d.ts.map +1 -0
- package/dist/shared/config/env.config.js +58 -0
- package/dist/shared/constants/app-version.constant.d.ts +2 -0
- package/dist/shared/constants/app-version.constant.d.ts.map +1 -0
- package/dist/shared/constants/app-version.constant.js +1 -0
- package/dist/shared/services/cli-update.service.d.ts +29 -0
- package/dist/shared/services/cli-update.service.d.ts.map +1 -0
- package/dist/shared/services/cli-update.service.js +206 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.page.d.ts","sourceRoot":"","sources":["../../../../src/modules/profile/pages/profile.page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAOvE,KAAK,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAKrD,KAAK,gBAAgB,GAAG;IACtB,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,CAAC,oBAAoB,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC9F,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB,CAAC;AAwBF,wBAAgB,WAAW,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,EAAE,gBAAgB,2CAwQhG"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { getUserDisplayName } from '../../auth/utils/auth-user.util.js';
|
|
5
|
+
import { ActionMenuPage } from '../../../shared/components/action-menu.component.js';
|
|
6
|
+
import { StepHeader } from '../../../shared/components/step-header.component.js';
|
|
7
|
+
import { TextField } from '../../../shared/components/text-field.component.js';
|
|
8
|
+
const PROFILE_ACTIONS = [
|
|
9
|
+
{
|
|
10
|
+
value: 'change-display-name',
|
|
11
|
+
label: 'Alterar display name',
|
|
12
|
+
description: 'Atualiza o nome exibido diretamente no Supabase.',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: 'change-password',
|
|
16
|
+
label: 'Alterar senha',
|
|
17
|
+
description: 'Troca a senha da conta autenticada.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: 'back',
|
|
21
|
+
label: 'Voltar ao menu',
|
|
22
|
+
description: 'Retorna ao menu principal da CLI.',
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
function isReauthenticationRequired(errorCode) {
|
|
26
|
+
return errorCode === 'reauthentication_needed' || errorCode === 'reauth_nonce_missing';
|
|
27
|
+
}
|
|
28
|
+
export function ProfilePage({ authService, onBack, onNotificationChange, user }) {
|
|
29
|
+
const currentDisplayName = getUserDisplayName(user);
|
|
30
|
+
const [step, setStep] = useState('menu');
|
|
31
|
+
const [selectedActionIndex, setSelectedActionIndex] = useState(0);
|
|
32
|
+
const [displayName, setDisplayName] = useState(currentDisplayName ?? '');
|
|
33
|
+
const [newPassword, setNewPassword] = useState('');
|
|
34
|
+
const [confirmPassword, setConfirmPassword] = useState('');
|
|
35
|
+
const [passwordFocus, setPasswordFocus] = useState('new-password');
|
|
36
|
+
const [nonce, setNonce] = useState('');
|
|
37
|
+
const [pendingPassword, setPendingPassword] = useState('');
|
|
38
|
+
const [busy, setBusy] = useState(false);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
setDisplayName(currentDisplayName ?? '');
|
|
41
|
+
}, [currentDisplayName]);
|
|
42
|
+
function resetPasswordFlow() {
|
|
43
|
+
setNewPassword('');
|
|
44
|
+
setConfirmPassword('');
|
|
45
|
+
setNonce('');
|
|
46
|
+
setPendingPassword('');
|
|
47
|
+
setPasswordFocus('new-password');
|
|
48
|
+
}
|
|
49
|
+
function returnToProfileMenu() {
|
|
50
|
+
setStep('menu');
|
|
51
|
+
setSelectedActionIndex(0);
|
|
52
|
+
resetPasswordFlow();
|
|
53
|
+
setDisplayName(currentDisplayName ?? '');
|
|
54
|
+
}
|
|
55
|
+
async function handleDisplayNameSubmit() {
|
|
56
|
+
const trimmedDisplayName = displayName.trim();
|
|
57
|
+
if (!trimmedDisplayName) {
|
|
58
|
+
onNotificationChange('Informe um display name valido para continuar.', 'error');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (trimmedDisplayName === currentDisplayName) {
|
|
62
|
+
onNotificationChange('O display name informado ja esta em uso na sua conta.', 'info');
|
|
63
|
+
returnToProfileMenu();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
setBusy(true);
|
|
67
|
+
const result = await authService.updateDisplayName(trimmedDisplayName);
|
|
68
|
+
setBusy(false);
|
|
69
|
+
if (result.error) {
|
|
70
|
+
onNotificationChange(result.error, 'error');
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
onNotificationChange(`Display name atualizado para "${trimmedDisplayName}".`, 'success');
|
|
74
|
+
returnToProfileMenu();
|
|
75
|
+
}
|
|
76
|
+
async function requestPasswordReauthentication(password) {
|
|
77
|
+
const reauthenticationResult = await authService.sendPasswordReauthenticationCode();
|
|
78
|
+
if (reauthenticationResult.error) {
|
|
79
|
+
onNotificationChange(reauthenticationResult.error, 'error');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
setPendingPassword(password);
|
|
83
|
+
setNonce('');
|
|
84
|
+
setStep('confirm-password-code');
|
|
85
|
+
onNotificationChange('O Supabase enviou um codigo de verificacao. Digite esse codigo para concluir a troca de senha.', 'info');
|
|
86
|
+
}
|
|
87
|
+
async function handlePasswordSubmit(password, currentNonce) {
|
|
88
|
+
if (!password.trim()) {
|
|
89
|
+
onNotificationChange('Informe a nova senha para continuar.', 'error');
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
setBusy(true);
|
|
93
|
+
const result = await authService.updatePassword(password, currentNonce);
|
|
94
|
+
setBusy(false);
|
|
95
|
+
if (result.error) {
|
|
96
|
+
if (isReauthenticationRequired(result.errorCode) && !currentNonce) {
|
|
97
|
+
await requestPasswordReauthentication(password);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
onNotificationChange(result.error, 'error');
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
onNotificationChange('Senha atualizada com sucesso.', 'success');
|
|
104
|
+
returnToProfileMenu();
|
|
105
|
+
}
|
|
106
|
+
async function handleNewPasswordSubmit() {
|
|
107
|
+
if (!newPassword.trim() || !confirmPassword.trim()) {
|
|
108
|
+
onNotificationChange('Preencha a nova senha e a confirmacao.', 'error');
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (newPassword !== confirmPassword) {
|
|
112
|
+
onNotificationChange('A confirmacao de senha nao confere.', 'error');
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
await handlePasswordSubmit(newPassword);
|
|
116
|
+
}
|
|
117
|
+
async function handlePasswordNonceSubmit() {
|
|
118
|
+
const trimmedNonce = nonce.trim();
|
|
119
|
+
if (!trimmedNonce) {
|
|
120
|
+
onNotificationChange('Informe o codigo de verificacao enviado pelo Supabase.', 'error');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
await handlePasswordSubmit(pendingPassword, trimmedNonce);
|
|
124
|
+
}
|
|
125
|
+
useInput((_input, key) => {
|
|
126
|
+
if (busy) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (step === 'menu') {
|
|
130
|
+
if (key.escape) {
|
|
131
|
+
onBack();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (key.upArrow) {
|
|
135
|
+
setSelectedActionIndex((current) => (current === 0 ? PROFILE_ACTIONS.length - 1 : current - 1));
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (key.downArrow) {
|
|
139
|
+
setSelectedActionIndex((current) => (current === PROFILE_ACTIONS.length - 1 ? 0 : current + 1));
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (key.return) {
|
|
143
|
+
const action = PROFILE_ACTIONS[selectedActionIndex];
|
|
144
|
+
if (!action || action.value === 'back') {
|
|
145
|
+
onBack();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
onNotificationChange(null);
|
|
149
|
+
setStep(action.value);
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (key.escape) {
|
|
154
|
+
onNotificationChange(null);
|
|
155
|
+
returnToProfileMenu();
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (step === 'change-password' && (key.tab || key.upArrow || key.downArrow)) {
|
|
159
|
+
setPasswordFocus((current) => (current === 'new-password' ? 'confirm-password' : 'new-password'));
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
if (step === 'menu') {
|
|
163
|
+
return (_jsxs(ActionMenuPage, { title: "Profile", subtitle: "Escolha uma acao para gerenciar sua conta autenticada.", options: PROFILE_ACTIONS, selectedIndex: selectedActionIndex, hintText: "Use as setas para navegar. Enter confirma. Esc volta ao menu.", children: [_jsxs(Text, { children: ["Email: ", user.email ?? 'nao informado'] }), _jsxs(Text, { children: ["Display name: ", currentDisplayName ?? 'nao definido'] })] }));
|
|
164
|
+
}
|
|
165
|
+
if (step === 'change-display-name') {
|
|
166
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(StepHeader, { title: "Alterar display name", subtitle: `Atual: ${currentDisplayName ?? 'nao definido'}. Digite o novo nome e pressione Enter.` }), _jsx(TextField, { placeholder: "Ex.: Leonardo", value: displayName, onChange: setDisplayName, onSubmit: () => {
|
|
167
|
+
void handleDisplayNameSubmit();
|
|
168
|
+
} }), _jsx(Text, { dimColor: true, children: "Esc volta para o menu de profile." })] }));
|
|
169
|
+
}
|
|
170
|
+
if (step === 'confirm-password-code') {
|
|
171
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(StepHeader, { title: "Confirmar troca de senha", subtitle: "Digite o codigo recebido por email ou telefone para concluir a troca da senha." }), _jsx(TextField, { placeholder: "Codigo de verificacao", value: nonce, onChange: setNonce, onSubmit: () => {
|
|
172
|
+
void handlePasswordNonceSubmit();
|
|
173
|
+
} }), _jsx(Text, { dimColor: true, children: "Esc volta para o menu de profile." })] }));
|
|
174
|
+
}
|
|
175
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(StepHeader, { title: "Alterar senha", subtitle: "Defina a nova senha. Se o Supabase pedir reautenticacao, um codigo sera enviado automaticamente." }), _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: passwordFocus === 'new-password' ? 'greenBright' : 'white', children: "Nova senha" }), _jsx(TextField, { focus: passwordFocus === 'new-password', mask: "*", placeholder: "Digite a nova senha", value: newPassword, onChange: setNewPassword, onSubmit: () => {
|
|
176
|
+
setPasswordFocus('confirm-password');
|
|
177
|
+
} })] }), _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: passwordFocus === 'confirm-password' ? 'greenBright' : 'white', children: "Confirmar senha" }), _jsx(TextField, { focus: passwordFocus === 'confirm-password', mask: "*", placeholder: "Repita a nova senha", value: confirmPassword, onChange: setConfirmPassword, onSubmit: () => {
|
|
178
|
+
void handleNewPasswordSubmit();
|
|
179
|
+
} })] }), _jsx(Text, { dimColor: true, children: "Tab ou setas alternam o campo ativo. Enter envia. Esc volta ao menu de profile." })] }));
|
|
180
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type RadioOption } from './radio-select.component.js';
|
|
3
|
+
type ActionMenuPageProps<TValue extends string> = {
|
|
4
|
+
readonly children?: ReactNode;
|
|
5
|
+
readonly hintText: string;
|
|
6
|
+
readonly options: readonly RadioOption<TValue>[];
|
|
7
|
+
readonly selectedIndex: number;
|
|
8
|
+
readonly subtitle: string;
|
|
9
|
+
readonly title: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function ActionMenuPage<TValue extends string>({ children, hintText, options, selectedIndex, subtitle, title, }: ActionMenuPageProps<TValue>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=action-menu.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-menu.component.d.ts","sourceRoot":"","sources":["../../../src/shared/components/action-menu.component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG5E,KAAK,mBAAmB,CAAC,MAAM,SAAS,MAAM,IAAI;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;IACjD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,SAAS,MAAM,EAAE,EACpD,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,QAAQ,EACR,KAAK,GACN,EAAE,mBAAmB,CAAC,MAAM,CAAC,2CAS7B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { RadioSelect } from './radio-select.component.js';
|
|
4
|
+
import { StepHeader } from './step-header.component.js';
|
|
5
|
+
export function ActionMenuPage({ children, hintText, options, selectedIndex, subtitle, title, }) {
|
|
6
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(StepHeader, { title: title, subtitle: subtitle }), children ? _jsx(Box, { flexDirection: "column", marginBottom: 1, children: children }) : null, _jsx(RadioSelect, { options: options, selectedIndex: selectedIndex }), _jsx(Text, { dimColor: true, children: hintText })] }));
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-logo.component.d.ts","sourceRoot":"","sources":["../../../src/shared/components/app-logo.component.tsx"],"names":[],"mappings":"AAWA,wBAAgB,OAAO,4CAUtB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
const LOGO_LINES = [
|
|
4
|
+
'████████╗██████╗ ███████╗███╗ ██╗██████╗ ██╗███████╗██╗ ██╗',
|
|
5
|
+
'╚══██╔══╝██╔══██╗██╔════╝████╗ ██║██╔══██╗██║██╔════╝╚██╗ ██╔╝',
|
|
6
|
+
' ██║ ██████╔╝█████╗ ██╔██╗ ██║██║ ██║██║█████╗ ╚████╔╝ ',
|
|
7
|
+
' ██║ ██╔══██╗██╔══╝ ██║╚██╗██║██║ ██║██║██╔══╝ ╚██╔╝ ',
|
|
8
|
+
' ██║ ██║ ██║███████╗██║ ╚████║██████╔╝██║██║ ██║ ',
|
|
9
|
+
' ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝╚═════╝ ╚═╝╚═╝ ╚═╝ ',
|
|
10
|
+
];
|
|
11
|
+
export function AppLogo() {
|
|
12
|
+
return (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: LOGO_LINES.map((line) => (_jsx(Text, { color: "greenBright", children: line }, line))) }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type AppMenuItem = {
|
|
2
|
+
readonly aliases: readonly string[];
|
|
3
|
+
readonly comando: string;
|
|
4
|
+
readonly descricao: string;
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly palavrasChave: readonly string[];
|
|
7
|
+
readonly titulo: string;
|
|
8
|
+
};
|
|
9
|
+
type AppMenuProps = {
|
|
10
|
+
readonly initialInput: string;
|
|
11
|
+
readonly items: readonly AppMenuItem[];
|
|
12
|
+
readonly onInputChange?: (value: string) => void;
|
|
13
|
+
readonly onSelect: (item: AppMenuItem) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function AppMenu({ initialInput, items, onInputChange, onSelect }: AppMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=app-menu.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-menu.component.d.ts","sourceRoot":"","sources":["../../../src/shared/components/app-menu.component.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IACvC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;CAChD,CAAC;AAwDF,wBAAgB,OAAO,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,YAAY,2CAyErF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import { TextField } from './text-field.component.js';
|
|
4
|
+
import { useMemo, useState } from 'react';
|
|
5
|
+
function normalize(text) {
|
|
6
|
+
return text
|
|
7
|
+
.normalize('NFD')
|
|
8
|
+
.replace(/\p{Diacritic}/gu, '')
|
|
9
|
+
.toLowerCase()
|
|
10
|
+
.trim();
|
|
11
|
+
}
|
|
12
|
+
function scoreItem(item, query) {
|
|
13
|
+
const normalizedCommand = normalize(item.comando);
|
|
14
|
+
const normalizedAliases = item.aliases.map(normalize);
|
|
15
|
+
const normalizedText = [item.titulo, item.descricao, ...item.palavrasChave].map(normalize);
|
|
16
|
+
if (normalizedCommand === query || normalizedAliases.includes(query)) {
|
|
17
|
+
return 100;
|
|
18
|
+
}
|
|
19
|
+
if (normalizedCommand.startsWith(query) || normalizedAliases.some((alias) => alias.startsWith(query))) {
|
|
20
|
+
return 80;
|
|
21
|
+
}
|
|
22
|
+
if (normalizedCommand.includes(query) ||
|
|
23
|
+
normalizedAliases.some((alias) => alias.includes(query)) ||
|
|
24
|
+
normalizedText.some((text) => text.includes(query))) {
|
|
25
|
+
return 50;
|
|
26
|
+
}
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
function truncate(text, maxLength) {
|
|
30
|
+
if (text.length <= maxLength) {
|
|
31
|
+
return text;
|
|
32
|
+
}
|
|
33
|
+
return `${text.slice(0, maxLength - 1)}…`;
|
|
34
|
+
}
|
|
35
|
+
function filterItems(items, query) {
|
|
36
|
+
const normalizedQuery = normalize(query);
|
|
37
|
+
if (!normalizedQuery) {
|
|
38
|
+
return [...items];
|
|
39
|
+
}
|
|
40
|
+
return [...items]
|
|
41
|
+
.map((item) => ({ item, score: scoreItem(item, normalizedQuery) }))
|
|
42
|
+
.filter(({ score }) => score > 0)
|
|
43
|
+
.sort((left, right) => right.score - left.score)
|
|
44
|
+
.map(({ item }) => item);
|
|
45
|
+
}
|
|
46
|
+
export function AppMenu({ initialInput, items, onInputChange, onSelect }) {
|
|
47
|
+
const [inputValue, setInputValue] = useState(initialInput);
|
|
48
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
49
|
+
const menuOpen = inputValue.startsWith('/');
|
|
50
|
+
const query = menuOpen ? inputValue.slice(1) : '';
|
|
51
|
+
const filteredItems = useMemo(() => filterItems(items, query), [items, query]);
|
|
52
|
+
const selectedItem = filteredItems[selectedIndex] ?? filteredItems[0];
|
|
53
|
+
useInput((input, key) => {
|
|
54
|
+
if (key.escape) {
|
|
55
|
+
setInputValue('');
|
|
56
|
+
setSelectedIndex(0);
|
|
57
|
+
onInputChange?.('');
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (!menuOpen || filteredItems.length === 0) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (key.upArrow) {
|
|
64
|
+
setSelectedIndex((current) => (current === 0 ? filteredItems.length - 1 : current - 1));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (key.downArrow) {
|
|
68
|
+
setSelectedIndex((current) => (current === filteredItems.length - 1 ? 0 : current + 1));
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(TextField, { placeholder: "Digite / para abrir o menu", value: inputValue, onChange: (value) => {
|
|
72
|
+
setInputValue(value);
|
|
73
|
+
setSelectedIndex(0);
|
|
74
|
+
onInputChange?.(value);
|
|
75
|
+
}, onSubmit: () => {
|
|
76
|
+
if (menuOpen && selectedItem) {
|
|
77
|
+
onSelect(selectedItem);
|
|
78
|
+
}
|
|
79
|
+
} }), menuOpen ? (_jsx(Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, width: 72, marginTop: 1, children: filteredItems.length > 0 ? (filteredItems.map((item, index) => {
|
|
80
|
+
const selected = item.id === selectedItem?.id && index === selectedIndex;
|
|
81
|
+
const title = truncate(item.titulo, 18).padEnd(18, ' ');
|
|
82
|
+
const description = truncate(item.descricao, 42);
|
|
83
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: selected ? 'greenBright' : 'white', children: [selected ? '› ' : ' ', title] }), _jsxs(Text, { dimColor: true, children: [" ", description] })] }, item.id));
|
|
84
|
+
})) : (_jsx(Text, { dimColor: true, children: "Nenhum comando encontrado." })) })) : null] }));
|
|
85
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
type AppShellProps = {
|
|
3
|
+
readonly appVersion: string;
|
|
4
|
+
readonly children: ReactNode;
|
|
5
|
+
readonly notification?: string | null;
|
|
6
|
+
readonly notificationTone?: 'error' | 'info' | 'success';
|
|
7
|
+
readonly subtitle: string;
|
|
8
|
+
readonly title: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function AppShell({ appVersion, children, notification, notificationTone, subtitle, title, }: AppShellProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=app-shell.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-shell.component.d.ts","sourceRoot":"","sources":["../../../src/shared/components/app-shell.component.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAcF,wBAAgB,QAAQ,CAAC,EACvB,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,gBAA4B,EAC5B,QAAQ,EACR,KAAK,GACN,EAAE,aAAa,2CAef"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AppLogo } from './app-logo.component.js';
|
|
3
|
+
import { Box, Text } from 'ink';
|
|
4
|
+
function getNotificationColor(tone) {
|
|
5
|
+
if (tone === 'error') {
|
|
6
|
+
return 'redBright';
|
|
7
|
+
}
|
|
8
|
+
if (tone === 'info') {
|
|
9
|
+
return 'cyanBright';
|
|
10
|
+
}
|
|
11
|
+
return 'greenBright';
|
|
12
|
+
}
|
|
13
|
+
export function AppShell({ appVersion, children, notification, notificationTone = 'success', subtitle, title, }) {
|
|
14
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [_jsx(AppLogo, {}), _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { color: "cyanBright", children: ["CLI v", appVersion] }), _jsx(Text, { children: title }), _jsx(Text, { dimColor: true, children: subtitle }), notification ? _jsx(Text, { color: getNotificationColor(notificationTone), children: notification }) : null] }), children] }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type RadioOption<TValue extends string> = {
|
|
2
|
+
readonly description: string;
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly value: TValue;
|
|
5
|
+
};
|
|
6
|
+
type RadioSelectProps<TValue extends string> = {
|
|
7
|
+
readonly options: readonly RadioOption<TValue>[];
|
|
8
|
+
readonly selectedIndex: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function RadioSelect<TValue extends string>({ options, selectedIndex }: RadioSelectProps<TValue>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=radio-select.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-select.component.d.ts","sourceRoot":"","sources":["../../../src/shared/components/radio-select.component.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,CAAC,MAAM,SAAS,MAAM,IAAI;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,gBAAgB,CAAC,MAAM,SAAS,MAAM,IAAI;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;IACjD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,CAAC;AAUF,wBAAgB,WAAW,CAAC,MAAM,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,2CAoBtG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
function truncate(text, maxLength) {
|
|
4
|
+
if (text.length <= maxLength) {
|
|
5
|
+
return text;
|
|
6
|
+
}
|
|
7
|
+
return `${text.slice(0, maxLength - 1)}…`;
|
|
8
|
+
}
|
|
9
|
+
export function RadioSelect({ options, selectedIndex }) {
|
|
10
|
+
return (_jsx(Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, width: 72, children: options.map((option, index) => {
|
|
11
|
+
const selected = index === selectedIndex;
|
|
12
|
+
const label = truncate(option.label, 20).padEnd(20, ' ');
|
|
13
|
+
const description = truncate(option.description, 40);
|
|
14
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: selected ? 'greenBright' : 'white', children: [selected ? '◉ ' : '○ ', label] }), _jsxs(Text, { dimColor: true, children: [" ", description] })] }, option.value));
|
|
15
|
+
}) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type StepHeaderProps = {
|
|
2
|
+
readonly subtitle: string;
|
|
3
|
+
readonly title: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function StepHeader({ subtitle, title }: StepHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=step-header.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-header.component.d.ts","sourceRoot":"","sources":["../../../src/shared/components/step-header.component.tsx"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,2CAO9D"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export function StepHeader({ subtitle, title }) {
|
|
4
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: "yellow", children: title }), _jsx(Text, { dimColor: true, children: subtitle })] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type TextFieldProps = {
|
|
2
|
+
readonly focus?: boolean;
|
|
3
|
+
readonly mask?: string;
|
|
4
|
+
readonly onChange: (value: string) => void;
|
|
5
|
+
readonly onSubmit?: (value: string) => void;
|
|
6
|
+
readonly placeholder: string;
|
|
7
|
+
readonly value: string;
|
|
8
|
+
readonly width?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function TextField({ focus, mask, onChange, onSubmit, placeholder, value, width }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=text-field.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.component.d.ts","sourceRoot":"","sources":["../../../src/shared/components/text-field.component.tsx"],"names":[],"mappings":"AAGA,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EAAE,KAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,KAAU,EAAE,EAAE,cAAc,2CAanH"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from 'ink';
|
|
3
|
+
import TextInput from 'ink-text-input';
|
|
4
|
+
export function TextField({ focus = true, mask, onChange, onSubmit, placeholder, value, width = 72 }) {
|
|
5
|
+
return (_jsx(Box, { borderStyle: "round", borderColor: "green", paddingX: 1, width: width, children: _jsx(TextInput, { focus: focus, mask: mask, placeholder: placeholder, value: value, onChange: onChange, onSubmit: onSubmit }) }));
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-paths.config.d.ts","sourceRoot":"","sources":["../../../src/shared/config/app-paths.config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,QAA+B,CAAC;AAC9D,eAAO,MAAM,iBAAiB,QAAkC,CAAC;AACjE,eAAO,MAAM,0BAA0B,QAA0C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
export const TRENDIFY_HOME_DIR = join(homedir(), '.trendify');
|
|
4
|
+
export const TRENDIFY_AUTH_DIR = join(TRENDIFY_HOME_DIR, 'auth');
|
|
5
|
+
export const TRENDIFY_AUTH_STORAGE_FILE = join(TRENDIFY_AUTH_DIR, 'storage.json');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CliEnv = {
|
|
2
|
+
readonly supabasePublishableDefaultKey: string;
|
|
3
|
+
readonly supabaseUrl: string;
|
|
4
|
+
};
|
|
5
|
+
export type EnvValidationResult = {
|
|
6
|
+
readonly ok: true;
|
|
7
|
+
readonly env: CliEnv;
|
|
8
|
+
} | {
|
|
9
|
+
readonly error: string;
|
|
10
|
+
readonly ok: false;
|
|
11
|
+
};
|
|
12
|
+
export declare function getCliEnvValidationResult(): EnvValidationResult;
|
|
13
|
+
export declare const CLI_APP_ROOT_DIRECTORY: string;
|
|
14
|
+
//# sourceMappingURL=env.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.config.d.ts","sourceRoot":"","sources":["../../../src/shared/config/env.config.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB,GACD;IACE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;CACpB,CAAC;AAsBN,wBAAgB,yBAAyB,IAAI,mBAAmB,CA+B/D;AAED,eAAO,MAAM,sBAAsB,QAAmB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { config as loadEnv } from 'dotenv';
|
|
5
|
+
const currentFilePath = fileURLToPath(import.meta.url);
|
|
6
|
+
const currentDirectory = dirname(currentFilePath);
|
|
7
|
+
const appRootDirectory = resolve(currentDirectory, '..', '..');
|
|
8
|
+
const workspaceRootDirectory = resolve(appRootDirectory, '..', '..');
|
|
9
|
+
const ENV_FILE_PATHS = [
|
|
10
|
+
resolve(appRootDirectory, '.env'),
|
|
11
|
+
resolve(workspaceRootDirectory, '.env'),
|
|
12
|
+
resolve(process.cwd(), '.env'),
|
|
13
|
+
];
|
|
14
|
+
let envLoaded = false;
|
|
15
|
+
function loadCliEnvFiles() {
|
|
16
|
+
if (envLoaded) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
for (const envFilePath of ENV_FILE_PATHS) {
|
|
20
|
+
if (existsSync(envFilePath)) {
|
|
21
|
+
loadEnv({ override: false, path: envFilePath, quiet: true });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
envLoaded = true;
|
|
25
|
+
}
|
|
26
|
+
function readEnvValue(name) {
|
|
27
|
+
const value = process.env[name]?.trim();
|
|
28
|
+
return value ? value : undefined;
|
|
29
|
+
}
|
|
30
|
+
export function getCliEnvValidationResult() {
|
|
31
|
+
loadCliEnvFiles();
|
|
32
|
+
const supabaseUrl = readEnvValue('SUPABASE_URL');
|
|
33
|
+
const supabasePublishableDefaultKey = readEnvValue('SUPABASE_PUBLISHABLE_DEFAULT_KEY');
|
|
34
|
+
const missingVariables = [
|
|
35
|
+
!supabaseUrl ? 'SUPABASE_URL' : null,
|
|
36
|
+
!supabasePublishableDefaultKey ? 'SUPABASE_PUBLISHABLE_DEFAULT_KEY' : null,
|
|
37
|
+
].filter((value) => Boolean(value));
|
|
38
|
+
if (missingVariables.length > 0) {
|
|
39
|
+
return {
|
|
40
|
+
ok: false,
|
|
41
|
+
error: `Defina ${missingVariables.join(' e ')} antes de iniciar a CLI.`,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (!supabaseUrl || !supabasePublishableDefaultKey) {
|
|
45
|
+
return {
|
|
46
|
+
ok: false,
|
|
47
|
+
error: 'Nao foi possivel validar as variaveis do Supabase.',
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
ok: true,
|
|
52
|
+
env: {
|
|
53
|
+
supabaseUrl,
|
|
54
|
+
supabasePublishableDefaultKey,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export const CLI_APP_ROOT_DIRECTORY = appRootDirectory;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-version.constant.d.ts","sourceRoot":"","sources":["../../../src/shared/constants/app-version.constant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const APP_VERSION = '0.1.7';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type CliUpdateCheckResult = {
|
|
2
|
+
readonly currentVersion: string;
|
|
3
|
+
readonly packageName: string;
|
|
4
|
+
readonly status: 'checking';
|
|
5
|
+
} | {
|
|
6
|
+
readonly currentVersion: string;
|
|
7
|
+
readonly latestVersion: string;
|
|
8
|
+
readonly packageName: string;
|
|
9
|
+
readonly status: 'available';
|
|
10
|
+
} | {
|
|
11
|
+
readonly currentVersion: string;
|
|
12
|
+
readonly latestVersion: string;
|
|
13
|
+
readonly packageName: string;
|
|
14
|
+
readonly status: 'current';
|
|
15
|
+
} | {
|
|
16
|
+
readonly currentVersion: string;
|
|
17
|
+
readonly message: string;
|
|
18
|
+
readonly packageName: string;
|
|
19
|
+
readonly status: 'error';
|
|
20
|
+
};
|
|
21
|
+
export type CliSelfUpdateResult = {
|
|
22
|
+
readonly ok: true;
|
|
23
|
+
} | {
|
|
24
|
+
readonly error: string;
|
|
25
|
+
readonly ok: false;
|
|
26
|
+
};
|
|
27
|
+
export declare function checkForCliUpdate(currentVersion: string): Promise<CliUpdateCheckResult>;
|
|
28
|
+
export declare function runCliSelfUpdate(packageName: string, latestVersion: string): Promise<CliSelfUpdateResult>;
|
|
29
|
+
//# sourceMappingURL=cli-update.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-update.service.d.ts","sourceRoot":"","sources":["../../../src/shared/services/cli-update.service.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,oBAAoB,GAC5B;IACE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B,GACD;IACE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B,GACD;IACE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;CAC5B,GACD;IACE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEN,MAAM,MAAM,mBAAmB,GAC3B;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;CACnB,GACD;IACE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;CACpB,CAAC;AA4MN,wBAAsB,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA6B7F;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAwB/G"}
|