@danhachuel/prodmaker 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/CHANGELOG.md +36 -0
- package/MANUAL-INSTALACAO.md +4 -1
- package/README.md +1 -1
- package/app/api/vendas.py +167 -0
- package/app/main.py +18 -5
- package/app/services/clone.py +7 -3
- package/app/services/database.py +27 -0
- package/app/services/dominios.py +2 -2
- package/app/services/gads.py +109 -0
- package/app/services/gamma.py +2 -2
- package/app/services/pdf.py +7 -3
- package/app/services/publish.py +2 -2
- package/app/services/store.py +10 -0
- package/app/services/vendas.py +324 -0
- package/frontend/dist/assets/index-BrfPg9k5.js +69 -0
- package/frontend/dist/index.html +1 -1
- package/package.json +1 -1
- package/scripts/cli.mjs +23 -3
- package/frontend/dist/assets/index-83L_ji8k.js +0 -68
package/frontend/dist/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
rel="stylesheet"
|
|
16
16
|
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0&display=block"
|
|
17
17
|
/>
|
|
18
|
-
<script type="module" crossorigin src="/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-BrfPg9k5.js"></script>
|
|
19
19
|
<link rel="stylesheet" crossorigin href="/assets/index-B88UVmZI.css">
|
|
20
20
|
</head>
|
|
21
21
|
<body>
|
package/package.json
CHANGED
package/scripts/cli.mjs
CHANGED
|
@@ -14,7 +14,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
14
14
|
const PKG_ROOT = path.resolve(__dirname, "..");
|
|
15
15
|
const APP_DIR = path.join(PKG_ROOT, "app");
|
|
16
16
|
const REQUIREMENTS = path.join(PKG_ROOT, "requirements.txt");
|
|
17
|
-
const APP_VERSION = "0.1.
|
|
17
|
+
const APP_VERSION = "0.1.08";
|
|
18
18
|
const DEFAULT_PORT = 8188;
|
|
19
19
|
|
|
20
20
|
const STORAGE_FOLDERS = ["state", "pages", "produtos", "artifacts", "downloads", "logs"];
|
|
@@ -76,7 +76,7 @@ function venvPython(home) {
|
|
|
76
76
|
return fs.existsSync(candidate) ? candidate : null;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
function printUrlBox(port) {
|
|
79
|
+
function printUrlBox(port, masterCode) {
|
|
80
80
|
const url = `http://localhost:${port}`;
|
|
81
81
|
const line = (text) => `| ${text}${" ".repeat(Math.max(0, 43 - text.length))}|`;
|
|
82
82
|
console.log("");
|
|
@@ -84,6 +84,10 @@ function printUrlBox(port) {
|
|
|
84
84
|
console.log(line("ProdMaker rodando em:"));
|
|
85
85
|
console.log(line(`>>> ${url}`));
|
|
86
86
|
console.log(line("Abra esta URL MANUALMENTE no navegador."));
|
|
87
|
+
console.log(line(""));
|
|
88
|
+
console.log(line(`CODIGO DE ATIVACAO: ${masterCode}`));
|
|
89
|
+
console.log(line("Login: qualquer e-mail + este codigo"));
|
|
90
|
+
console.log(line('(ou digite "admin" como codigo)'));
|
|
87
91
|
console.log("+" + "-".repeat(45) + "+");
|
|
88
92
|
console.log("");
|
|
89
93
|
}
|
|
@@ -152,6 +156,21 @@ async function commandInstall(flags) {
|
|
|
152
156
|
console.log("Depois abra http://localhost:8188 MANUALMENTE no navegador (o sistema nunca abre o navegador).");
|
|
153
157
|
}
|
|
154
158
|
|
|
159
|
+
async function fetchMasterCode(python, home) {
|
|
160
|
+
if (python) {
|
|
161
|
+
try {
|
|
162
|
+
const result = spawnSync(python, ["-c", "from app.services.store import get_master_code; print(get_master_code())"], {
|
|
163
|
+
cwd: PKG_ROOT,
|
|
164
|
+
encoding: "utf8",
|
|
165
|
+
env: { ...process.env, PRODMAKER_HOME: home },
|
|
166
|
+
});
|
|
167
|
+
const value = (result.stdout || "").trim().split(/\r?\n/).pop() || "";
|
|
168
|
+
if (result.status === 0 && value) return value;
|
|
169
|
+
} catch {}
|
|
170
|
+
}
|
|
171
|
+
return (process.env.PRODMAKER_MASTER_CODE || "").trim() || "1234";
|
|
172
|
+
}
|
|
173
|
+
|
|
155
174
|
async function commandRun() {
|
|
156
175
|
const home = resolveHome();
|
|
157
176
|
const settingsPath = storagePath(home, "state", "settings.json");
|
|
@@ -190,7 +209,8 @@ async function commandRun() {
|
|
|
190
209
|
: ["-m", "uvicorn", "app.main:app", "--host", "127.0.0.1", "--port", String(port)];
|
|
191
210
|
|
|
192
211
|
console.log("Iniciando ProdMaker...");
|
|
193
|
-
|
|
212
|
+
const masterCode = await fetchMasterCode(pythonCmd, home);
|
|
213
|
+
printUrlBox(port, masterCode);
|
|
194
214
|
|
|
195
215
|
const env = { ...process.env, PRODMAKER_HOME: home, PRODMAKER_PORT: String(port) };
|
|
196
216
|
const child = spawn(pythonCmd, pythonArgs, {
|