@tgtone/auth-sdk 1.2.0 → 1.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/dist/tgtone-auth-client.d.ts.map +1 -1
- package/dist/tgtone-auth-client.js +6 -4
- package/dist/tgtone-auth-client.js.map +1 -1
- package/docs/LOVABLE_QUICK_START.md +131 -383
- package/docs/NPM_PUBLISH.md +71 -62
- package/docs/README.md +20 -48
- package/package.json +1 -1
- package/docs/SDK_FINAL_STATUS.md +0 -88
- package/docs/SDK_INTEGRATION_RULES.md +0 -433
- package/docs/tgtone-identity-auth.code-workspace +0 -11
package/docs/NPM_PUBLISH.md
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
# 📦 Publicar
|
|
1
|
+
# 📦 Publicar @tgtone/auth-sdk a NPM
|
|
2
|
+
|
|
3
|
+
> Guía para publicar nuevas versiones del SDK de autenticación
|
|
4
|
+
|
|
5
|
+
---
|
|
2
6
|
|
|
3
7
|
## ✅ Pre-requisitos
|
|
4
8
|
|
|
5
9
|
1. **Cuenta en NPM**: https://www.npmjs.com/signup
|
|
6
|
-
2. **
|
|
10
|
+
2. **Permisos en organización @tgtone**
|
|
11
|
+
3. **Login en terminal**:
|
|
7
12
|
```bash
|
|
8
13
|
npm login
|
|
9
14
|
# Ingresar: username, password, email, OTP (si tienes 2FA)
|
|
@@ -11,93 +16,87 @@ npm login
|
|
|
11
16
|
|
|
12
17
|
---
|
|
13
18
|
|
|
14
|
-
## 🚀
|
|
19
|
+
## 🚀 Proceso de Publicación
|
|
15
20
|
|
|
16
21
|
### 1. Ir a la carpeta del SDK
|
|
17
22
|
```bash
|
|
18
|
-
cd /home/jam/develop/tgtone/tgtone-
|
|
23
|
+
cd /home/jam/develop/tgtone/tgtone-console/packages/auth-sdk
|
|
19
24
|
```
|
|
20
25
|
|
|
21
|
-
### 2. Limpiar build anterior
|
|
22
|
-
```bash
|
|
23
|
-
npm run clean
|
|
24
|
-
```
|
|
25
26
|
|
|
26
|
-
###
|
|
27
|
+
### 2. Actualizar versión (si aplica)
|
|
27
28
|
```bash
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
# Patch (1.2.0 → 1.2.1) - Bug fixes
|
|
30
|
+
npm version patch
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
npm pack --dry-run
|
|
34
|
-
```
|
|
32
|
+
# Minor (1.2.0 → 1.3.0) - Nuevas features
|
|
33
|
+
npm version minor
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- README.md
|
|
39
|
-
- package.json
|
|
40
|
-
- dist/
|
|
41
|
-
- docs/
|
|
35
|
+
# Major (1.2.0 → 2.0.0) - Breaking changes
|
|
36
|
+
npm version major
|
|
42
37
|
```
|
|
43
38
|
|
|
44
|
-
###
|
|
39
|
+
### 3. Limpiar build anterior
|
|
45
40
|
```bash
|
|
46
|
-
npm
|
|
41
|
+
npm run clean
|
|
47
42
|
```
|
|
48
43
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## 🔄 Para Actualizar Versión
|
|
52
|
-
|
|
53
|
-
### Patch (1.0.2 → 1.0.3) - Bug fixes
|
|
44
|
+
### 4. Compilar TypeScript
|
|
54
45
|
```bash
|
|
55
|
-
npm
|
|
56
|
-
npm publish
|
|
46
|
+
npm run build
|
|
57
47
|
```
|
|
58
48
|
|
|
59
|
-
###
|
|
49
|
+
### 5. Verificar archivos a publicar
|
|
60
50
|
```bash
|
|
61
|
-
npm
|
|
62
|
-
npm publish
|
|
51
|
+
npm pack --dry-run
|
|
63
52
|
```
|
|
64
53
|
|
|
65
|
-
|
|
54
|
+
Debe incluir:
|
|
55
|
+
- ✅ `dist/` (código compilado)
|
|
56
|
+
- ✅ `README.md`
|
|
57
|
+
- ✅ `docs/` (documentación)
|
|
58
|
+
- ✅ `package.json`
|
|
59
|
+
|
|
60
|
+
### 6. Publicar a NPM
|
|
66
61
|
```bash
|
|
67
|
-
npm version major
|
|
68
62
|
npm publish
|
|
69
63
|
```
|
|
70
64
|
|
|
71
65
|
---
|
|
72
66
|
|
|
73
|
-
##
|
|
67
|
+
## 📦 Verificar Publicación
|
|
74
68
|
|
|
75
|
-
Una vez publicado:
|
|
76
69
|
```bash
|
|
77
70
|
# Ver en NPM
|
|
78
|
-
https://www.npmjs.com/package/
|
|
71
|
+
open https://www.npmjs.com/package/@tgtone/auth-sdk
|
|
79
72
|
|
|
80
|
-
#
|
|
81
|
-
npm install tgtone
|
|
73
|
+
# Probar instalación
|
|
74
|
+
npm install @tgtone/auth-sdk@latest
|
|
82
75
|
```
|
|
83
76
|
|
|
84
77
|
---
|
|
85
78
|
|
|
86
|
-
## 🔐
|
|
79
|
+
## 🔐 Token NPM para CI/CD
|
|
87
80
|
|
|
88
|
-
Para publicar desde GitHub Actions
|
|
81
|
+
Para publicar automáticamente desde GitHub Actions:
|
|
89
82
|
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
**1. Crear token en NPM:**
|
|
84
|
+
```
|
|
92
85
|
https://www.npmjs.com/settings/YOUR_USER/tokens
|
|
86
|
+
→ Generate New Token → Automation
|
|
87
|
+
```
|
|
93
88
|
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
**2. Agregar a GitHub Secrets:**
|
|
90
|
+
```
|
|
91
|
+
Repo Settings → Secrets and variables → Actions → New secret
|
|
96
92
|
Name: NPM_TOKEN
|
|
97
93
|
Value: npm_xxx...
|
|
94
|
+
```
|
|
98
95
|
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
**3. Usar en workflow:**
|
|
97
|
+
```yaml
|
|
98
|
+
- name: Publish to NPM
|
|
99
|
+
run: npm publish
|
|
101
100
|
env:
|
|
102
101
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
103
102
|
```
|
|
@@ -106,26 +105,36 @@ Value: npm_xxx...
|
|
|
106
105
|
|
|
107
106
|
## 📋 Checklist Pre-publicación
|
|
108
107
|
|
|
109
|
-
- [
|
|
110
|
-
- [
|
|
111
|
-
- [
|
|
112
|
-
- [
|
|
113
|
-
- [
|
|
114
|
-
- [
|
|
115
|
-
- [ ]
|
|
108
|
+
- [ ] Código actualizado y funcional
|
|
109
|
+
- [ ] Tests pasando (si los hay)
|
|
110
|
+
- [ ] Versión incrementada en `package.json`
|
|
111
|
+
- [ ] `README.md` actualizado con cambios
|
|
112
|
+
- [ ] Documentación en `docs/` actualizada
|
|
113
|
+
- [ ] Build exitoso (`npm run build`)
|
|
114
|
+
- [ ] Login en NPM (`npm whoami`)
|
|
116
115
|
|
|
117
116
|
---
|
|
118
117
|
|
|
119
|
-
##
|
|
118
|
+
## ⚡ Comandos Rápidos
|
|
120
119
|
|
|
121
120
|
```bash
|
|
122
|
-
# Todo en uno (
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
npm publish
|
|
121
|
+
# Todo en uno (publicación completa)
|
|
122
|
+
npm run clean && npm run build && npm publish
|
|
123
|
+
|
|
124
|
+
# Con bump de versión patch
|
|
125
|
+
npm version patch && npm run clean && npm run build && npm publish
|
|
127
126
|
```
|
|
128
127
|
|
|
129
128
|
---
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
## 📌 Información del Package
|
|
131
|
+
|
|
132
|
+
**Nombre:** `@tgtone/auth-sdk`
|
|
133
|
+
**Scope:** `@tgtone` (organización NPM)
|
|
134
|
+
**Versión actual:** 1.2.0
|
|
135
|
+
**Registry:** https://registry.npmjs.org
|
|
136
|
+
**Package URL:** https://www.npmjs.com/package/@tgtone/auth-sdk
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
**Última actualización:** 2025-11-03
|
package/docs/README.md
CHANGED
|
@@ -6,53 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
## 🚀 Quick Start
|
|
8
8
|
|
|
9
|
-
**[⬆️ README principal](../README.md)** - Instalación y uso
|
|
9
|
+
**[⬆️ README principal](../README.md)** - Instalación, API completa y ejemplos de uso
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
## 📖 Guías
|
|
13
|
+
## 📖 Guías Disponibles
|
|
14
14
|
|
|
15
15
|
### **[LOVABLE_QUICK_START.md](./LOVABLE_QUICK_START.md)** ⭐
|
|
16
|
-
Guía para Lovable/React:
|
|
17
|
-
- Setup
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
16
|
+
Guía específica para Lovable/React:
|
|
17
|
+
- Setup rápido con ejemplos
|
|
18
|
+
- Uso de hooks
|
|
19
|
+
- Gestión de sesión
|
|
20
|
+
- Roles y permisos
|
|
21
21
|
|
|
22
22
|
### **[INTEGRATION_EXAMPLES.md](./INTEGRATION_EXAMPLES.md)**
|
|
23
23
|
Ejemplos para otros frameworks:
|
|
24
|
-
- Vue.js
|
|
24
|
+
- Vue.js
|
|
25
25
|
- Next.js (App Router)
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## 🛠️ Configuración
|
|
26
|
+
- Angular 17+
|
|
27
|
+
- Configuración por app
|
|
31
28
|
|
|
32
29
|
### **[NPM_PUBLISH.md](./NPM_PUBLISH.md)**
|
|
33
|
-
Guía para publicar actualizaciones
|
|
34
|
-
|
|
35
|
-
### **[SDK_FINAL_STATUS.md](./SDK_FINAL_STATUS.md)**
|
|
36
|
-
Estado actual del SDK y estructura de archivos
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## 🔧 Estructura del SDK
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
sdk/
|
|
44
|
-
├── tgtone-auth-client.ts # SDK principal (Bearer Token)
|
|
45
|
-
├── react-hook.tsx # Hook de React (opcional)
|
|
46
|
-
├── index.ts # Exports
|
|
47
|
-
├── package.json # v1.0.2
|
|
48
|
-
├── README.md # Guía principal
|
|
49
|
-
└── docs/ # Documentación completa
|
|
50
|
-
├── README.md # Este archivo
|
|
51
|
-
├── LOVABLE_QUICK_START.md
|
|
52
|
-
├── INTEGRATION_EXAMPLES.md
|
|
53
|
-
├── NPM_PUBLISH.md
|
|
54
|
-
└── SDK_FINAL_STATUS.md
|
|
55
|
-
```
|
|
30
|
+
Guía para publicar actualizaciones del SDK a npm
|
|
56
31
|
|
|
57
32
|
---
|
|
58
33
|
|
|
@@ -60,24 +35,21 @@ sdk/
|
|
|
60
35
|
|
|
61
36
|
| Quiero... | Ver |
|
|
62
37
|
|-----------|-----|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
| Ejemplos Vue/Next | [INTEGRATION_EXAMPLES.md](./INTEGRATION_EXAMPLES.md) |
|
|
66
|
-
| Publicar
|
|
38
|
+
| Instalar y usar en cualquier app | [README.md](../README.md) |
|
|
39
|
+
| Integrar en Lovable/React | [LOVABLE_QUICK_START.md](./LOVABLE_QUICK_START.md) |
|
|
40
|
+
| Ejemplos Vue/Next/Angular | [INTEGRATION_EXAMPLES.md](./INTEGRATION_EXAMPLES.md) |
|
|
41
|
+
| Publicar nueva versión | [NPM_PUBLISH.md](./NPM_PUBLISH.md) |
|
|
67
42
|
|
|
68
43
|
---
|
|
69
44
|
|
|
70
45
|
## 🔐 Información Clave
|
|
71
46
|
|
|
72
|
-
**
|
|
47
|
+
**Versión Actual:** 1.2.0
|
|
48
|
+
**Autenticación:** JWT + Bearer Token (Authorization header)
|
|
73
49
|
**Storage:** localStorage (`tgtone_auth_token`)
|
|
74
|
-
**
|
|
75
|
-
**
|
|
76
|
-
|
|
77
|
-
**Versión Actual:** 1.0.2
|
|
78
|
-
**Backend Staging:** https://tgtone-identity-backend-1086175589490.us-central1.run.app
|
|
79
|
-
**Backend Producción:** (Pendiente configurar identity.tgtone.cl)
|
|
50
|
+
**Backend:** https://tgtone-console-backend.run.app/api
|
|
51
|
+
**Identity:** https://identity.tgtone.cl
|
|
80
52
|
|
|
81
53
|
---
|
|
82
54
|
|
|
83
|
-
**Última actualización:** 2025-
|
|
55
|
+
**Última actualización:** 2025-11-03
|
package/package.json
CHANGED
package/docs/SDK_FINAL_STATUS.md
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# ✅ SDK Organizado - Resumen Final
|
|
2
|
-
|
|
3
|
-
## 📁 Estructura Actual
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
sdk/
|
|
7
|
-
├── README.md # ✅ Guía principal (simplificado, 70 líneas)
|
|
8
|
-
├── package.json # ✅ Actualizado (v1.0.2, incluye docs/)
|
|
9
|
-
├── tsconfig.json
|
|
10
|
-
├── index.ts # Entry point
|
|
11
|
-
├── tgtone-auth-client.ts # ✅ SDK (limpio, sin cookies)
|
|
12
|
-
├── react-hook.tsx # Hook React
|
|
13
|
-
├── .npmignore
|
|
14
|
-
├── dist/ # Archivos compilados
|
|
15
|
-
└── docs/
|
|
16
|
-
├── README.md # ✅ Índice de documentación
|
|
17
|
-
├── LOVABLE_QUICK_START.md # ✅ Guía para Lovable
|
|
18
|
-
├── INTEGRATION_EXAMPLES.md # Ejemplos otros frameworks
|
|
19
|
-
├── CHANGELOG.md # Historial versiones
|
|
20
|
-
├── ORGANIZATION_SUMMARY.md # Este resumen
|
|
21
|
-
└── README_OLD.md # Archivo (referencia)
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## ✅ Cambios Completados
|
|
27
|
-
|
|
28
|
-
### 1. Código SDK
|
|
29
|
-
- ✅ Eliminado `credentials: 'include'` (ya no usamos cookies)
|
|
30
|
-
- ✅ Solo Bearer Token en Authorization header
|
|
31
|
-
- ✅ localStorage para guardar tokens
|
|
32
|
-
|
|
33
|
-
### 2. Documentación
|
|
34
|
-
- ✅ README.md simplificado (70 líneas vs 391)
|
|
35
|
-
- ✅ Creada carpeta `docs/` con toda la doc organizada
|
|
36
|
-
- ✅ `LOVABLE_QUICK_START.md` - Guía específica para Lovable
|
|
37
|
-
- ✅ `docs/README.md` - Índice completo
|
|
38
|
-
- ✅ README antiguo archivado como referencia
|
|
39
|
-
|
|
40
|
-
### 3. Package.json
|
|
41
|
-
- ✅ Versión actualizada: `1.0.1` → `1.0.2`
|
|
42
|
-
- ✅ Descripción actualizada: "JWT + Bearer Token"
|
|
43
|
-
- ✅ Files incluye carpeta `docs/`
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## 📖 Guía de Uso
|
|
48
|
-
|
|
49
|
-
### Para desarrollar en Lovable
|
|
50
|
-
1. Leer: `docs/LOVABLE_QUICK_START.md`
|
|
51
|
-
2. Copiar: `tgtone-auth-client.ts` a tu proyecto
|
|
52
|
-
3. Usar código de ejemplo
|
|
53
|
-
|
|
54
|
-
### Para instalar vía NPM
|
|
55
|
-
```bash
|
|
56
|
-
npm install tgtone-auth-client
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Ver: `README.md`
|
|
60
|
-
|
|
61
|
-
### Para otros frameworks
|
|
62
|
-
Ver: `docs/INTEGRATION_EXAMPLES.md`
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## 🎯 Documentación por Necesidad
|
|
67
|
-
|
|
68
|
-
| Necesitas... | Archivo |
|
|
69
|
-
|--------------|---------|
|
|
70
|
-
| Setup rápido | `README.md` |
|
|
71
|
-
| Lovable/React | `docs/LOVABLE_QUICK_START.md` |
|
|
72
|
-
| Vue/Next/Angular | `docs/INTEGRATION_EXAMPLES.md` |
|
|
73
|
-
| API completa | `README.md` + `docs/README_OLD.md` |
|
|
74
|
-
| Ver cambios | `docs/CHANGELOG.md` |
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## 🚀 Listo para Usar
|
|
79
|
-
|
|
80
|
-
El SDK está completamente organizado y listo para:
|
|
81
|
-
- ✅ Copiar archivo directamente a Lovable
|
|
82
|
-
- ✅ Instalar vía NPM (si está publicado)
|
|
83
|
-
- ✅ Integrar en cualquier framework
|
|
84
|
-
- ✅ Testing con tokens manuales
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
**Última actualización:** 2025-10-16
|