entexto-cli 2.0.0 → 2.0.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.
@@ -195,7 +195,7 @@ entexto api query <slug>
195
195
 
196
196
  ```javascript
197
197
  // Autenticación con API Key
198
- const resp = await fetch('https://api.entexto.com/v1/api/mi-api/collections/usuarios/documents', {
198
+ const resp = await fetch('https://api.entexto.com/v1/api/projects/mi-api/data/usuarios', {
199
199
  method: 'POST',
200
200
  headers: {
201
201
  'Content-Type': 'application/json',
@@ -214,7 +214,7 @@ const login = await fetch('https://api.entexto.com/v1/api/auth/login', {
214
214
  });
215
215
  const { token } = await login.json();
216
216
 
217
- const docs = await fetch('https://api.entexto.com/v1/api/mi-api/collections/usuarios/documents', {
217
+ const docs = await fetch('https://api.entexto.com/v1/api/projects/mi-api/data/usuarios', {
218
218
  headers: { 'Authorization': `Bearer ${token}` }
219
219
  });
220
220
  ```
@@ -476,17 +476,17 @@ entexto api insert tienda-api
476
476
 
477
477
  Usar desde el frontend:
478
478
  ```javascript
479
- const API_BASE = 'https://api.entexto.com/v1/api/tienda-api';
479
+ const API_BASE = 'https://api.entexto.com/v1/api/projects/tienda-api';
480
480
  const API_KEY = 'tu-api-key';
481
481
 
482
482
  // Listar productos
483
- const res = await fetch(`${API_BASE}/collections/productos/documents`, {
483
+ const res = await fetch(`${API_BASE}/data/productos`, {
484
484
  headers: { 'X-API-Key': API_KEY }
485
485
  });
486
486
  const { documents } = await res.json();
487
487
 
488
488
  // Crear pedido
489
- await fetch(`${API_BASE}/collections/pedidos/documents`, {
489
+ await fetch(`${API_BASE}/data/pedidos`, {
490
490
  method: 'POST',
491
491
  headers: {
492
492
  'Content-Type': 'application/json',
@@ -126,7 +126,7 @@ async function ejecutarDeploy(uuid, dir, publish, full) {
126
126
  : await deployFiles(uuid, form, false);
127
127
 
128
128
  spinner.stop();
129
- (result.archivos || []).forEach(r => console.log(' ' + chalk.green('') + ' ' + chalk.white(r)));
129
+ (result.archivos || []).forEach(r => console.log(' ' + chalk.green('') + ' ' + chalk.white(typeof r === 'string' ? r : r.ruta || r)));
130
130
  console.log(
131
131
  chalk.bold.green(`\n Deploy ${result.total || aSubir.length} subido(s)`)
132
132
  + (omitidos.length ? chalk.gray(`, ${omitidos.length} sin cambios`) : '') + '\n'
@@ -202,4 +202,4 @@ module.exports = async function (options) {
202
202
  watcher.on('error', err => console.error(chalk.red(' [watch] Error: ' + err.message)));
203
203
  };
204
204
 
205
- module.exports.subirArchivoSolo = subirArchivoSolo;
205
+ module.exports.subirArchivoSolo = subirArchivoSolo;
package/lib/utils/api.js CHANGED
@@ -104,16 +104,16 @@ async function deleteFileRemote(uuid, ruta) {
104
104
  // ─── Projects CRUD ─────────────────────────────────────────
105
105
  async function createProject(data) {
106
106
  const res = await client().post('/api/projects', data);
107
- return res.data;
107
+ return res.data.project || res.data;
108
108
  }
109
109
 
110
110
  // ─── Dominios ──────────────────────────────────────────────
111
111
  async function listDomains() {
112
112
  const res = await client().get('/api/domains/list');
113
- return res.data;
113
+ return res.data.domains || res.data || [];
114
114
  }
115
115
 
116
- async function addDomain(domain, projectId) {
116
+ async function addDomain(projectId, domain) {
117
117
  const res = await client().post('/api/domains/add', { domain, project_id: projectId });
118
118
  return res.data;
119
119
  }
@@ -158,7 +158,7 @@ async function apiCreateCollection(slug, name) {
158
158
 
159
159
  async function apiInsertDoc(slug, collection, data) {
160
160
  const res = await client().post(
161
- `/v1/api/projects/${encodeURIComponent(slug)}/collections/${encodeURIComponent(collection)}/documents`,
161
+ `/v1/api/projects/${encodeURIComponent(slug)}/data/${encodeURIComponent(collection)}`,
162
162
  { data }
163
163
  );
164
164
  return res.data;
@@ -166,7 +166,7 @@ async function apiInsertDoc(slug, collection, data) {
166
166
 
167
167
  async function apiQueryDocs(slug, collection) {
168
168
  const res = await client().get(
169
- `/v1/api/projects/${encodeURIComponent(slug)}/collections/${encodeURIComponent(collection)}/documents`
169
+ `/v1/api/projects/${encodeURIComponent(slug)}/data/${encodeURIComponent(collection)}`
170
170
  );
171
171
  return res.data;
172
172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "entexto-cli",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "CLI oficial de Entexto — Crea, deploya y gestiona proyectos, dominios, APIs y Live SDK desde tu terminal",
5
5
  "main": "lib/index.js",
6
6
  "bin": {