ar-saas 0.2.0 → 0.2.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ignacio Becher
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -197,7 +197,33 @@ Los tokens JWT viajan **únicamente en cookies HttpOnly**. Nunca en `localStorag
197
197
 
198
198
  ## Licencia
199
199
 
200
- MIT el código generado es completamente tuyo, sin restricciones de uso comercial.
200
+ MIT © 2026 [Ignacio Becher](https://github.com/ignaciobecher)
201
+
202
+ El código generado por esta herramienta es completamente tuyo, sin restricciones de uso comercial. Podés usarlo, modificarlo y distribuirlo libremente.
203
+
204
+ ---
205
+
206
+ ## Legal
207
+
208
+ **Propiedad del código generado**
209
+
210
+ Todo el código que `ar-saas` genera en tu proyecto te pertenece a vos. No reclamamos ningún derecho sobre el código generado ni sobre los productos que construyas con él.
211
+
212
+ **Sin garantías**
213
+
214
+ Esta herramienta se provee "tal cual" (*as is*), sin garantías de ningún tipo. No nos hacemos responsables por:
215
+
216
+ - Vulnerabilidades de seguridad en el código generado si modificás la configuración por defecto
217
+ - Daños directos o indirectos derivados del uso del software
218
+ - Pérdida de datos o interrupciones de servicio en proyectos construidos con esta herramienta
219
+
220
+ **Dependencias de terceros**
221
+
222
+ El código generado incluye dependencias de terceros (NestJS, Next.js, MongoDB, etc.), cada una con su propia licencia. Es tu responsabilidad revisar y cumplir con los términos de cada dependencia en tu proyecto.
223
+
224
+ **Seguridad**
225
+
226
+ Si encontrás una vulnerabilidad de seguridad en esta herramienta, por favor reportala abriendo un issue en el [repositorio de GitHub](https://github.com/ignaciobecher/ar-saas) en lugar de hacerlo público. Intentaremos resolverlo a la brevedad.
201
227
 
202
228
  ---
203
229
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-saas",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Generador de proyectos SaaS multi-tenant para startups argentinas",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/dist/license.js DELETED
@@ -1,71 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateLicense = validateLicense;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const os_1 = __importDefault(require("os"));
10
- const CACHE_DIR = path_1.default.join(os_1.default.homedir(), '.ar-saas');
11
- const CACHE_FILE = path_1.default.join(CACHE_DIR, 'license');
12
- const LICENSE_API = 'https://api.create-saas-ar.dev/licenses/validate';
13
- const LICENSE_REGEX = /^CSAR-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}$/;
14
- async function validateLicense(license) {
15
- const normalized = license.trim().toUpperCase();
16
- if (!LICENSE_REGEX.test(normalized)) {
17
- return {
18
- valid: false,
19
- error: 'Formato inválido. La licencia debe tener el formato CSAR-XXXX-XXXX-XXXX',
20
- };
21
- }
22
- const cached = readCache();
23
- if (cached === normalized) {
24
- return { valid: true };
25
- }
26
- try {
27
- const controller = new AbortController();
28
- const timeout = setTimeout(() => controller.abort(), 5000);
29
- const response = await fetch(LICENSE_API, {
30
- method: 'POST',
31
- headers: { 'Content-Type': 'application/json' },
32
- body: JSON.stringify({ license: normalized }),
33
- signal: controller.signal,
34
- });
35
- clearTimeout(timeout);
36
- if (!response.ok) {
37
- return { valid: false, error: 'Licencia inválida o expirada' };
38
- }
39
- const data = (await response.json());
40
- if (data.valid) {
41
- writeCache(normalized);
42
- return { valid: true };
43
- }
44
- return { valid: false, error: 'Licencia inválida o expirada' };
45
- }
46
- catch {
47
- // Fail open: si la API no está disponible, aceptar la licencia
48
- writeCache(normalized);
49
- return { valid: true };
50
- }
51
- }
52
- function readCache() {
53
- try {
54
- if (fs_1.default.existsSync(CACHE_FILE)) {
55
- return fs_1.default.readFileSync(CACHE_FILE, 'utf-8').trim();
56
- }
57
- }
58
- catch {
59
- // ignore
60
- }
61
- return null;
62
- }
63
- function writeCache(license) {
64
- try {
65
- fs_1.default.mkdirSync(CACHE_DIR, { recursive: true });
66
- fs_1.default.writeFileSync(CACHE_FILE, license, 'utf-8');
67
- }
68
- catch {
69
- // ignore — no bloquear al usuario si no se puede escribir la caché
70
- }
71
- }