enerthya.dev-web-common 1.5.6 → 1.5.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/esm/constants/routes.js +34 -3
- package/package.json +1 -1
- package/src/constants/routes.js +29 -2
package/esm/constants/routes.js
CHANGED
|
@@ -90,8 +90,35 @@ const API_ROUTES = {
|
|
|
90
90
|
ADA: {
|
|
91
91
|
/** GET — Modelos disponíveis e configuração pública (sem chave API) */
|
|
92
92
|
CONFIG: "/ada/config",
|
|
93
|
-
/**
|
|
94
|
-
|
|
93
|
+
/** GET — Lista todas as conversas do usuário */
|
|
94
|
+
CHATS: "/ada/chats",
|
|
95
|
+
/** POST — Cria uma nova conversa */
|
|
96
|
+
CREATE_CHAT: "/ada/chats",
|
|
97
|
+
/**
|
|
98
|
+
* GET — Carrega mensagens de uma conversa
|
|
99
|
+
* @param {string} chatId - ID da conversa
|
|
100
|
+
*/
|
|
101
|
+
CHAT: (chatId) => `/ada/chats/${chatId}`,
|
|
102
|
+
/**
|
|
103
|
+
* POST — Envia mensagem em uma conversa
|
|
104
|
+
* @param {string} chatId - ID da conversa
|
|
105
|
+
*/
|
|
106
|
+
SEND_MESSAGE: (chatId) => `/ada/chats/${chatId}/message`,
|
|
107
|
+
/**
|
|
108
|
+
* POST — Limpa todas as mensagens de uma conversa
|
|
109
|
+
* @param {string} chatId - ID da conversa
|
|
110
|
+
*/
|
|
111
|
+
CLEAR_CHAT: (chatId) => `/ada/chats/${chatId}/clear`,
|
|
112
|
+
/**
|
|
113
|
+
* DELETE — Deleta uma conversa
|
|
114
|
+
* @param {string} chatId - ID da conversa
|
|
115
|
+
*/
|
|
116
|
+
DELETE_CHAT: (chatId) => `/ada/chats/${chatId}`,
|
|
117
|
+
/**
|
|
118
|
+
* PUT — Renomeia uma conversa
|
|
119
|
+
* @param {string} chatId - ID da conversa
|
|
120
|
+
*/
|
|
121
|
+
RENAME_CHAT: (chatId) => `/ada/chats/${chatId}/rename`,
|
|
95
122
|
},
|
|
96
123
|
|
|
97
124
|
// ─── Meta ─────────────────────────────────────────────────────────────────
|
|
@@ -103,7 +130,11 @@ const API_ROUTES = {
|
|
|
103
130
|
DEV: "/dev",
|
|
104
131
|
/** GET — Owner + helpers da documentação pública com username e avatar */
|
|
105
132
|
DOCS_CONTRIBUTORS: "/docs-contributors",
|
|
133
|
+
/**
|
|
134
|
+
* GET — Dados públicos de um usuário Discord (username + avatar)
|
|
135
|
+
* @param {string} id - Discord user ID
|
|
136
|
+
*/
|
|
106
137
|
DISCORD_USER: (id) => `/user/${id}`,
|
|
107
138
|
};
|
|
108
139
|
|
|
109
|
-
|
|
140
|
+
module.exports = { API_ROUTES };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enerthya.dev-web-common",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8",
|
|
4
4
|
"description": "Shared web layer for the Enerthya ecosystem: API routes, response envelopes, URL helpers and validators. Inspired by Loritta's web-common and dashboard-common modules.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
package/src/constants/routes.js
CHANGED
|
@@ -90,8 +90,35 @@ const API_ROUTES = {
|
|
|
90
90
|
ADA: {
|
|
91
91
|
/** GET — Modelos disponíveis e configuração pública (sem chave API) */
|
|
92
92
|
CONFIG: "/ada/config",
|
|
93
|
-
/**
|
|
94
|
-
|
|
93
|
+
/** GET — Lista todas as conversas do usuário */
|
|
94
|
+
CHATS: "/ada/chats",
|
|
95
|
+
/** POST — Cria uma nova conversa */
|
|
96
|
+
CREATE_CHAT: "/ada/chats",
|
|
97
|
+
/**
|
|
98
|
+
* GET — Carrega mensagens de uma conversa
|
|
99
|
+
* @param {string} chatId - ID da conversa
|
|
100
|
+
*/
|
|
101
|
+
CHAT: (chatId) => `/ada/chats/${chatId}`,
|
|
102
|
+
/**
|
|
103
|
+
* POST — Envia mensagem em uma conversa
|
|
104
|
+
* @param {string} chatId - ID da conversa
|
|
105
|
+
*/
|
|
106
|
+
SEND_MESSAGE: (chatId) => `/ada/chats/${chatId}/message`,
|
|
107
|
+
/**
|
|
108
|
+
* POST — Limpa todas as mensagens de uma conversa
|
|
109
|
+
* @param {string} chatId - ID da conversa
|
|
110
|
+
*/
|
|
111
|
+
CLEAR_CHAT: (chatId) => `/ada/chats/${chatId}/clear`,
|
|
112
|
+
/**
|
|
113
|
+
* DELETE — Deleta uma conversa
|
|
114
|
+
* @param {string} chatId - ID da conversa
|
|
115
|
+
*/
|
|
116
|
+
DELETE_CHAT: (chatId) => `/ada/chats/${chatId}`,
|
|
117
|
+
/**
|
|
118
|
+
* PUT — Renomeia uma conversa
|
|
119
|
+
* @param {string} chatId - ID da conversa
|
|
120
|
+
*/
|
|
121
|
+
RENAME_CHAT: (chatId) => `/ada/chats/${chatId}/rename`,
|
|
95
122
|
},
|
|
96
123
|
|
|
97
124
|
// ─── Meta ─────────────────────────────────────────────────────────────────
|