delore-crm-core 1.0.17 → 1.0.19

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/README.md CHANGED
@@ -206,3 +206,13 @@ const { opentelemetry } = require("delore-crm-core");
206
206
  - registro de eventos: `event.emit(name, data, attributes)`
207
207
  - registro de dependências: `dependency.record(name, attributes)`
208
208
  - registro de dependências: `dependency.record(name, attributes)`
209
+
210
+ ## Channels (catalogo de canais)
211
+
212
+ ```js
213
+ const { channels } = require("delore-crm-core");
214
+ ```
215
+
216
+ - `channels.catalog`: catalogo de canais em memória
217
+ - `channels.catalog.json`: catalogo de canais em arquivo JSON
218
+ - `channels.catalog.json`: catalogo de canais em arquivo JSON
@@ -0,0 +1,122 @@
1
+ {
2
+ "WhatsApp": {
3
+ "family": "whatsapp",
4
+ "label": "WhatsApp",
5
+ "icon": "mdi mdi-whatsapp",
6
+ "color": "#25d366",
7
+ "addressKind": "phone",
8
+ "capabilities": {
9
+ "text": true,
10
+ "mediaImage": true,
11
+ "mediaVideo": true,
12
+ "mediaAudio": true,
13
+ "mediaDocument": true,
14
+ "card": true,
15
+ "templates": false,
16
+ "presence": true,
17
+ "groups": true,
18
+ "deliveryStatus": false,
19
+ "profileImage": true
20
+ }
21
+ },
22
+ "WhatsAppBusiness": {
23
+ "family": "whatsapp",
24
+ "label": "WhatsApp Business",
25
+ "icon": "mdi mdi-whatsapp",
26
+ "color": "#25d366",
27
+ "addressKind": "phone",
28
+ "capabilities": {
29
+ "text": true,
30
+ "mediaImage": true,
31
+ "mediaVideo": true,
32
+ "mediaAudio": true,
33
+ "mediaDocument": true,
34
+ "card": false,
35
+ "templates": true,
36
+ "presence": false,
37
+ "groups": false,
38
+ "deliveryStatus": true,
39
+ "profileImage": false
40
+ }
41
+ },
42
+ "WhatsAppZAPI": {
43
+ "family": "whatsapp",
44
+ "label": "WhatsApp Z-API",
45
+ "icon": "mdi mdi-whatsapp",
46
+ "color": "#25d366",
47
+ "addressKind": "phone",
48
+ "capabilities": {
49
+ "text": true,
50
+ "mediaImage": true,
51
+ "mediaVideo": true,
52
+ "mediaAudio": true,
53
+ "mediaDocument": true,
54
+ "card": false,
55
+ "templates": false,
56
+ "presence": false,
57
+ "groups": true,
58
+ "deliveryStatus": false,
59
+ "profileImage": false
60
+ }
61
+ },
62
+ "WhatsAppZAPISys": {
63
+ "family": "whatsapp",
64
+ "label": "WhatsApp Z-API (Sistema)",
65
+ "icon": "mdi mdi-whatsapp",
66
+ "color": "#128c7e",
67
+ "addressKind": "phone",
68
+ "capabilities": {
69
+ "text": true,
70
+ "mediaImage": false,
71
+ "mediaVideo": false,
72
+ "mediaAudio": false,
73
+ "mediaDocument": false,
74
+ "card": false,
75
+ "templates": false,
76
+ "presence": false,
77
+ "groups": false,
78
+ "deliveryStatus": false,
79
+ "profileImage": false
80
+ }
81
+ },
82
+ "Messenger": {
83
+ "family": "meta",
84
+ "label": "Messenger",
85
+ "icon": "mdi mdi-facebook-messenger",
86
+ "color": "#1877f2",
87
+ "addressKind": "psid",
88
+ "capabilities": {
89
+ "text": true,
90
+ "mediaImage": true,
91
+ "mediaVideo": true,
92
+ "mediaAudio": true,
93
+ "mediaDocument": true,
94
+ "card": false,
95
+ "templates": false,
96
+ "presence": false,
97
+ "groups": false,
98
+ "deliveryStatus": false,
99
+ "profileImage": false
100
+ }
101
+ },
102
+ "Instagram": {
103
+ "family": "meta",
104
+ "label": "Instagram",
105
+ "icon": "mdi mdi-instagram",
106
+ "color": "#c13584",
107
+ "addressKind": "psid",
108
+ "capabilities": {
109
+ "text": true,
110
+ "mediaImage": true,
111
+ "mediaVideo": true,
112
+ "mediaAudio": true,
113
+ "mediaDocument": true,
114
+ "card": false,
115
+ "templates": false,
116
+ "presence": false,
117
+ "groups": false,
118
+ "deliveryStatus": false,
119
+ "profileImage": false
120
+ }
121
+ }
122
+ }
package/index.js CHANGED
@@ -12,6 +12,10 @@ const syncAccess = require("./sync/sync.access");
12
12
  const sequelizeDB = require("./db/sequelize_db");
13
13
  const utilCripto = require("./utils/utilCripto");
14
14
  const models = require("./db/models");
15
+ // Catálogo de canais de mensageria (fonte única de verdade). Metadados declarativos
16
+ // (label/ícone/cor/addressKind/capabilities) por provider, consumidos pelo backend
17
+ // (delore-crm-api) e espelhados no frontend (delore-crm-web).
18
+ const channelsCatalog = require("./channels/channels.catalog.json");
15
19
 
16
20
  const exported = Object.assign(
17
21
  {},
@@ -28,6 +32,7 @@ const exported = Object.assign(
28
32
  sequelizeDB,
29
33
  models,
30
34
  utilCripto,
35
+ channelsCatalog,
31
36
  },
32
37
  );
33
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delore-crm-core",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Core CRM utilities for Delore projects",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",