enerthya.dev-web-common 1.1.0 → 1.3.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.
@@ -13,7 +13,7 @@
13
13
  * already includes "/api", and the server mounts on "/api" as well.
14
14
  */
15
15
 
16
- export const API_ROUTES = {
16
+ const API_ROUTES = {
17
17
  // ─── Auth ────────────────────────────────────────────────────────────────
18
18
  AUTH: {
19
19
  /** GET — OAuth2 login redirect */
@@ -50,6 +50,26 @@ 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 JSON ({ config: { ...campos } })
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`,
69
+
70
+ // ─── Formulários ──────────────────────────────────────────────────────────
71
+ /** POST — Publica (ou atualiza) o painel de um formulário no canal configurado */
72
+ GUILD_FORMS_PUBLISH: (id, formId) => `/guilds/${id}/forms/${formId}/publish`,
53
73
 
54
74
  // ─── Daily ───────────────────────────────────────────────────────────────
55
75
  DAILY: {
@@ -61,6 +81,22 @@ export const API_ROUTES = {
61
81
  CLAIM: "/daily/claim",
62
82
  },
63
83
 
84
+ // ─── Beta ─────────────────────────────────────────────────────────────────
85
+ BETA: {
86
+ /** GET — Novidades beta (só beta testers e owner) */
87
+ NOVIDADES: "/beta/novidades",
88
+ },
89
+
90
+ // ─── Owner ────────────────────────────────────────────────────────────────
91
+ OWNER: {
92
+ /** GET — Lista todos os beta testers */
93
+ BETA_LIST: "/owner/beta",
94
+ /** POST — Adiciona beta tester por Discord ID */
95
+ BETA_ADD: "/owner/beta",
96
+ /** DELETE — Remove beta tester */
97
+ BETA_REMOVE: (id) => `/owner/beta/${id}`,
98
+ },
99
+
64
100
  // ─── Meta ─────────────────────────────────────────────────────────────────
65
101
  /** GET — Bot + shard status */
66
102
  STATUS: "/status",
@@ -70,3 +106,4 @@ export const API_ROUTES = {
70
106
  DEV: "/dev",
71
107
  };
72
108
 
109
+ module.exports = { API_ROUTES };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enerthya.dev-web-common",
3
- "version": "1.1.0",
3
+ "version": "1.3.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",
@@ -50,6 +50,26 @@ 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 JSON (campos de ID descartados automaticamente)
55
+ * @param {string} id
56
+ */
57
+ GUILD_TICKET_EXPORT: (id) => `/guilds/${id}/ticket/export`,
58
+ /**
59
+ * POST — Import ticket config from JSON ({ config: { ...campos } })
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`,
69
+
70
+ // ─── Formulários ──────────────────────────────────────────────────────────
71
+ /** POST — Publica (ou atualiza) o painel de um formulário no canal configurado */
72
+ GUILD_FORMS_PUBLISH: (id, formId) => `/guilds/${id}/forms/${formId}/publish`,
53
73
 
54
74
  // ─── Daily ───────────────────────────────────────────────────────────────
55
75
  DAILY: {
@@ -61,6 +81,22 @@ const API_ROUTES = {
61
81
  CLAIM: "/daily/claim",
62
82
  },
63
83
 
84
+ // ─── Beta ─────────────────────────────────────────────────────────────────
85
+ BETA: {
86
+ /** GET — Novidades beta (só beta testers e owner) */
87
+ NOVIDADES: "/beta/novidades",
88
+ },
89
+
90
+ // ─── Owner ────────────────────────────────────────────────────────────────
91
+ OWNER: {
92
+ /** GET — Lista todos os beta testers */
93
+ BETA_LIST: "/owner/beta",
94
+ /** POST — Adiciona beta tester por Discord ID */
95
+ BETA_ADD: "/owner/beta",
96
+ /** DELETE — Remove beta tester */
97
+ BETA_REMOVE: (id) => `/owner/beta/${id}`,
98
+ },
99
+
64
100
  // ─── Meta ─────────────────────────────────────────────────────────────────
65
101
  /** GET — Bot + shard status */
66
102
  STATUS: "/status",