enerthya.dev-web-common 1.1.0 → 1.2.0
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 -1
- package/package.json +1 -1
- package/src/constants/routes.js +32 -0
package/esm/constants/routes.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* already includes "/api", and the server mounts on "/api" as well.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const API_ROUTES = {
|
|
17
17
|
// ─── Auth ────────────────────────────────────────────────────────────────
|
|
18
18
|
AUTH: {
|
|
19
19
|
/** GET — OAuth2 login redirect */
|
|
@@ -50,6 +50,22 @@ export const API_ROUTES = {
|
|
|
50
50
|
* @param {string} id - Discord guild ID
|
|
51
51
|
*/
|
|
52
52
|
GUILD_COMMAND_SETTINGS: (id) => `/guilds/${id}/command-settings`,
|
|
53
|
+
/**
|
|
54
|
+
* GET — Export ticket config as YAML
|
|
55
|
+
* @param {string} id
|
|
56
|
+
*/
|
|
57
|
+
GUILD_TICKET_EXPORT: (id) => `/guilds/${id}/ticket/export`,
|
|
58
|
+
/**
|
|
59
|
+
* POST — Import ticket config from YAML ({ yaml: string })\
|
|
60
|
+
* @param {string} id
|
|
61
|
+
*/
|
|
62
|
+
GUILD_TICKET_IMPORT: (id) => `/guilds/${id}/ticket/import`,
|
|
63
|
+
/**
|
|
64
|
+
* POST — Publish a panel embed+buttons to its configured channel_id
|
|
65
|
+
* @param {string} id - Discord guild ID
|
|
66
|
+
* @param {number} panelId - Panel ID (from ticket.panels[].id)
|
|
67
|
+
*/
|
|
68
|
+
GUILD_TICKET_PANEL_PUBLISH: (id, panelId) => `/guilds/${id}/ticket/panel/${panelId}/publish`,
|
|
53
69
|
|
|
54
70
|
// ─── Daily ───────────────────────────────────────────────────────────────
|
|
55
71
|
DAILY: {
|
|
@@ -61,6 +77,22 @@ export const API_ROUTES = {
|
|
|
61
77
|
CLAIM: "/daily/claim",
|
|
62
78
|
},
|
|
63
79
|
|
|
80
|
+
// ─── Beta ─────────────────────────────────────────────────────────────────
|
|
81
|
+
BETA: {
|
|
82
|
+
/** GET — Novidades beta (só beta testers e owner) */
|
|
83
|
+
NOVIDADES: "/beta/novidades",
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
// ─── Owner ────────────────────────────────────────────────────────────────
|
|
87
|
+
OWNER: {
|
|
88
|
+
/** GET — Lista todos os beta testers */
|
|
89
|
+
BETA_LIST: "/owner/beta",
|
|
90
|
+
/** POST — Adiciona beta tester por Discord ID */
|
|
91
|
+
BETA_ADD: "/owner/beta",
|
|
92
|
+
/** DELETE — Remove beta tester */
|
|
93
|
+
BETA_REMOVE: (id) => `/owner/beta/${id}`,
|
|
94
|
+
},
|
|
95
|
+
|
|
64
96
|
// ─── Meta ─────────────────────────────────────────────────────────────────
|
|
65
97
|
/** GET — Bot + shard status */
|
|
66
98
|
STATUS: "/status",
|
|
@@ -70,3 +102,4 @@ export const API_ROUTES = {
|
|
|
70
102
|
DEV: "/dev",
|
|
71
103
|
};
|
|
72
104
|
|
|
105
|
+
module.exports = { API_ROUTES };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enerthya.dev-web-common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
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
|
@@ -50,6 +50,22 @@ const API_ROUTES = {
|
|
|
50
50
|
* @param {string} id - Discord guild ID
|
|
51
51
|
*/
|
|
52
52
|
GUILD_COMMAND_SETTINGS: (id) => `/guilds/${id}/command-settings`,
|
|
53
|
+
/**
|
|
54
|
+
* GET — Export ticket config as YAML
|
|
55
|
+
* @param {string} id
|
|
56
|
+
*/
|
|
57
|
+
GUILD_TICKET_EXPORT: (id) => `/guilds/${id}/ticket/export`,
|
|
58
|
+
/**
|
|
59
|
+
* POST — Import ticket config from YAML ({ yaml: string })\
|
|
60
|
+
* @param {string} id
|
|
61
|
+
*/
|
|
62
|
+
GUILD_TICKET_IMPORT: (id) => `/guilds/${id}/ticket/import`,
|
|
63
|
+
/**
|
|
64
|
+
* POST — Publish a panel embed+buttons to its configured channel_id
|
|
65
|
+
* @param {string} id - Discord guild ID
|
|
66
|
+
* @param {number} panelId - Panel ID (from ticket.panels[].id)
|
|
67
|
+
*/
|
|
68
|
+
GUILD_TICKET_PANEL_PUBLISH: (id, panelId) => `/guilds/${id}/ticket/panel/${panelId}/publish`,
|
|
53
69
|
|
|
54
70
|
// ─── Daily ───────────────────────────────────────────────────────────────
|
|
55
71
|
DAILY: {
|
|
@@ -61,6 +77,22 @@ const API_ROUTES = {
|
|
|
61
77
|
CLAIM: "/daily/claim",
|
|
62
78
|
},
|
|
63
79
|
|
|
80
|
+
// ─── Beta ─────────────────────────────────────────────────────────────────
|
|
81
|
+
BETA: {
|
|
82
|
+
/** GET — Novidades beta (só beta testers e owner) */
|
|
83
|
+
NOVIDADES: "/beta/novidades",
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
// ─── Owner ────────────────────────────────────────────────────────────────
|
|
87
|
+
OWNER: {
|
|
88
|
+
/** GET — Lista todos os beta testers */
|
|
89
|
+
BETA_LIST: "/owner/beta",
|
|
90
|
+
/** POST — Adiciona beta tester por Discord ID */
|
|
91
|
+
BETA_ADD: "/owner/beta",
|
|
92
|
+
/** DELETE — Remove beta tester */
|
|
93
|
+
BETA_REMOVE: (id) => `/owner/beta/${id}`,
|
|
94
|
+
},
|
|
95
|
+
|
|
64
96
|
// ─── Meta ─────────────────────────────────────────────────────────────────
|
|
65
97
|
/** GET — Bot + shard status */
|
|
66
98
|
STATUS: "/status",
|