evo360-types 1.3.532 → 1.3.538

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.
@@ -14,6 +14,7 @@ export declare const EvoNotificationsCollections: {
14
14
  readonly EmailTemplates: "email_templates";
15
15
  readonly WhatsAppChannels: "whatsapp_channels";
16
16
  readonly QuickReplyActions: "quick-reply-actions";
17
+ readonly SmsChannels: "sms_channels";
17
18
  };
18
19
  export type EvoNotificationsCollectionName = (typeof EvoNotificationsCollections)[keyof typeof EvoNotificationsCollections];
19
20
  export declare const NotificationTaskKindEnum: {
@@ -234,6 +235,16 @@ export interface IWabaChannelConfig extends IFireDoc {
234
235
  company_id?: string;
235
236
  enabled: boolean;
236
237
  }
238
+ export interface ISmsChannelConfig extends IFireDoc {
239
+ display_name: string;
240
+ /** Sender/remetente registrado na Infobip (quando ausente, usa o default do provider global). */
241
+ sender?: string;
242
+ /** DDI default para normalização E.164 de números locais (ex.: '55'). */
243
+ default_country_code?: string;
244
+ /** CPaaSX entity da clínica na Infobip — reservado; quando presente, vai no payload de envio. */
245
+ infobip_entity_id?: string;
246
+ enabled: boolean;
247
+ }
237
248
  export interface INotificationProviderConfig {
238
249
  id: string;
239
250
  provider_name: string;
@@ -50,6 +50,7 @@ exports.EvoNotificationsCollections = {
50
50
  EmailTemplates: "email_templates", // subcollection de email_channels
51
51
  WhatsAppChannels: "whatsapp_channels",
52
52
  QuickReplyActions: "quick-reply-actions", // feat-047: cross-channel actionable buttons/links
53
+ SmsChannels: "sms_channels", // feat-148: canal SMS (Infobip)
53
54
  };
54
55
  // ----- Task Runner integration
55
56
  exports.NotificationTaskKindEnum = {
@@ -41,6 +41,7 @@ export const EvoNotificationsCollections = {
41
41
  EmailTemplates: "email_templates", // subcollection de email_channels
42
42
  WhatsAppChannels: "whatsapp_channels",
43
43
  QuickReplyActions: "quick-reply-actions", // feat-047: cross-channel actionable buttons/links
44
+ SmsChannels: "sms_channels", // feat-148: canal SMS (Infobip)
44
45
  } as const;
45
46
 
46
47
  export type EvoNotificationsCollectionName =
@@ -392,6 +393,26 @@ export interface IWabaChannelConfig extends IFireDoc {
392
393
  enabled: boolean;
393
394
  }
394
395
 
396
+ // ======================================================
397
+ // SMS channels (Infobip) — feat-148
398
+ // Path: /tenants/{tenant}/apps/evo-notifications/sms_channels/{channelId}
399
+ //
400
+ // A credencial (API key Infobip) é GLOBAL — vive nos `settings` do provider em
401
+ // platform/evo-notifications/providers (secret ref, nunca em texto plano).
402
+ // O doc do tenant é o gate de opt-in + preferências de envio.
403
+ // ======================================================
404
+
405
+ export interface ISmsChannelConfig extends IFireDoc {
406
+ display_name: string;
407
+ /** Sender/remetente registrado na Infobip (quando ausente, usa o default do provider global). */
408
+ sender?: string;
409
+ /** DDI default para normalização E.164 de números locais (ex.: '55'). */
410
+ default_country_code?: string;
411
+ /** CPaaSX entity da clínica na Infobip — reservado; quando presente, vai no payload de envio. */
412
+ infobip_entity_id?: string;
413
+ enabled: boolean;
414
+ }
415
+
395
416
  // ======================================================
396
417
  // Nexus / platform: configuração global de providers de envio
397
418
  // Path Firestore: platform/evo-notifications/providers/{providerId}
@@ -115,6 +115,11 @@ export interface IChatbeeImportDoc extends IFireGlobalDoc {
115
115
  tenant: string;
116
116
  /** Destination hub-waba channel id — threads/tickets/messages carry this channel_id. */
117
117
  destination_channel_id: string;
118
+ /**
119
+ * Canal Chatbee de ORIGEM (id numérico = doc-id de chatbee-channels).
120
+ * Ausente/null = todo o tenant (comportamento anterior à feat-143).
121
+ */
122
+ source_channel_id?: string | null;
118
123
  /** 'analyze' = read-only pre-import pass; 'import' = the real import. */
119
124
  mode?: ChatbeeImportMode;
120
125
  /** Count-only preview: zero Firestore/PubSub/BQ writes, projects counters + totals. */
@@ -139,47 +144,62 @@ export interface IChatbeeImportDoc extends IFireGlobalDoc {
139
144
  export declare const ChatbeeImportRequestSchema: z.ZodObject<{
140
145
  tenant: z.ZodString;
141
146
  destination_channel_id: z.ZodString;
147
+ source_channel_id: z.ZodOptional<z.ZodString>;
142
148
  dry_run: z.ZodOptional<z.ZodBoolean>;
143
149
  }, "strip", z.ZodTypeAny, {
144
150
  tenant: string;
145
151
  destination_channel_id: string;
146
152
  dry_run?: boolean | undefined;
153
+ source_channel_id?: string | undefined;
147
154
  }, {
148
155
  tenant: string;
149
156
  destination_channel_id: string;
150
157
  dry_run?: boolean | undefined;
158
+ source_channel_id?: string | undefined;
151
159
  }>;
152
160
  export type IChatbeeImportRequestPayload = z.infer<typeof ChatbeeImportRequestSchema>;
153
161
  export declare const ChatbeeImportAnalyzeSchema: z.ZodObject<{
154
162
  tenant: z.ZodString;
155
163
  destination_channel_id: z.ZodString;
164
+ source_channel_id: z.ZodOptional<z.ZodString>;
156
165
  }, "strip", z.ZodTypeAny, {
157
166
  tenant: string;
158
167
  destination_channel_id: string;
168
+ source_channel_id?: string | undefined;
159
169
  }, {
160
170
  tenant: string;
161
171
  destination_channel_id: string;
172
+ source_channel_id?: string | undefined;
162
173
  }>;
163
174
  export type IChatbeeImportAnalyzePayload = z.infer<typeof ChatbeeImportAnalyzeSchema>;
164
175
  export declare const ChatbeeImportSaveDeptMapSchema: z.ZodObject<{
165
176
  tenant: z.ZodString;
166
177
  channel_id: z.ZodString;
178
+ /**
179
+ * Metadado: canal Chatbee de origem ao qual este mapa se refere.
180
+ * NÃO entra na chave do doc, que continua `{tenant}__{destinationChannelId}`.
181
+ */
182
+ source_channel_id: z.ZodOptional<z.ZodString>;
167
183
  /** chatbee_id → platform dept id (or CHANNEL_DEFAULT_DEPT_SENTINEL). */
168
184
  map: z.ZodRecord<z.ZodString, z.ZodString>;
169
185
  }, "strip", z.ZodTypeAny, {
170
186
  map: Record<string, string>;
171
187
  tenant: string;
172
188
  channel_id: string;
189
+ source_channel_id?: string | undefined;
173
190
  }, {
174
191
  map: Record<string, string>;
175
192
  tenant: string;
176
193
  channel_id: string;
194
+ source_channel_id?: string | undefined;
177
195
  }>;
178
196
  export type IChatbeeImportSaveDeptMapPayload = z.infer<typeof ChatbeeImportSaveDeptMapSchema>;
179
197
  export interface IChatbeeImportPubSubEvent {
180
198
  importId: string;
181
199
  tenant: string;
182
200
  destination_channel_id: string;
201
+ /** Canal Chatbee de origem; ausente/null = tenant inteiro. Deve sobreviver às continuações. */
202
+ source_channel_id?: string | null;
183
203
  /** 'analyze' = read-only pass; 'import' = real import. */
184
204
  mode: ChatbeeImportMode;
185
205
  dry_run: boolean;
@@ -18,15 +18,31 @@ exports.CHANNEL_DEFAULT_DEPT_SENTINEL = "__channel_default__";
18
18
  exports.ChatbeeImportRequestSchema = zod_1.z.object({
19
19
  tenant: zod_1.z.string().min(1),
20
20
  destination_channel_id: zod_1.z.string().min(1),
21
+ source_channel_id: zod_1.z
22
+ .string()
23
+ .regex(/^\d+$/, "source_channel_id deve ser o id numérico do canal Chatbee")
24
+ .optional(),
21
25
  dry_run: zod_1.z.boolean().optional(),
22
26
  });
23
27
  exports.ChatbeeImportAnalyzeSchema = zod_1.z.object({
24
28
  tenant: zod_1.z.string().min(1),
25
29
  destination_channel_id: zod_1.z.string().min(1),
30
+ source_channel_id: zod_1.z
31
+ .string()
32
+ .regex(/^\d+$/, "source_channel_id deve ser o id numérico do canal Chatbee")
33
+ .optional(),
26
34
  });
27
35
  exports.ChatbeeImportSaveDeptMapSchema = zod_1.z.object({
28
36
  tenant: zod_1.z.string().min(1),
29
37
  channel_id: zod_1.z.string().min(1),
38
+ /**
39
+ * Metadado: canal Chatbee de origem ao qual este mapa se refere.
40
+ * NÃO entra na chave do doc, que continua `{tenant}__{destinationChannelId}`.
41
+ */
42
+ source_channel_id: zod_1.z
43
+ .string()
44
+ .regex(/^\d+$/, "source_channel_id deve ser o id numérico do canal Chatbee")
45
+ .optional(),
30
46
  /** chatbee_id → platform dept id (or CHANNEL_DEFAULT_DEPT_SENTINEL). */
31
47
  map: zod_1.z.record(zod_1.z.string(), zod_1.z.string().min(1)),
32
48
  });
@@ -162,6 +162,11 @@ export interface IChatbeeImportDoc extends IFireGlobalDoc {
162
162
  tenant: string;
163
163
  /** Destination hub-waba channel id — threads/tickets/messages carry this channel_id. */
164
164
  destination_channel_id: string;
165
+ /**
166
+ * Canal Chatbee de ORIGEM (id numérico = doc-id de chatbee-channels).
167
+ * Ausente/null = todo o tenant (comportamento anterior à feat-143).
168
+ */
169
+ source_channel_id?: string | null;
165
170
  /** 'analyze' = read-only pre-import pass; 'import' = the real import. */
166
171
  mode?: ChatbeeImportMode;
167
172
  /** Count-only preview: zero Firestore/PubSub/BQ writes, projects counters + totals. */
@@ -189,6 +194,10 @@ export interface IChatbeeImportDoc extends IFireGlobalDoc {
189
194
  export const ChatbeeImportRequestSchema = z.object({
190
195
  tenant: z.string().min(1),
191
196
  destination_channel_id: z.string().min(1),
197
+ source_channel_id: z
198
+ .string()
199
+ .regex(/^\d+$/, "source_channel_id deve ser o id numérico do canal Chatbee")
200
+ .optional(),
192
201
  dry_run: z.boolean().optional(),
193
202
  });
194
203
 
@@ -199,6 +208,10 @@ export type IChatbeeImportRequestPayload = z.infer<
199
208
  export const ChatbeeImportAnalyzeSchema = z.object({
200
209
  tenant: z.string().min(1),
201
210
  destination_channel_id: z.string().min(1),
211
+ source_channel_id: z
212
+ .string()
213
+ .regex(/^\d+$/, "source_channel_id deve ser o id numérico do canal Chatbee")
214
+ .optional(),
202
215
  });
203
216
 
204
217
  export type IChatbeeImportAnalyzePayload = z.infer<
@@ -208,6 +221,14 @@ export type IChatbeeImportAnalyzePayload = z.infer<
208
221
  export const ChatbeeImportSaveDeptMapSchema = z.object({
209
222
  tenant: z.string().min(1),
210
223
  channel_id: z.string().min(1),
224
+ /**
225
+ * Metadado: canal Chatbee de origem ao qual este mapa se refere.
226
+ * NÃO entra na chave do doc, que continua `{tenant}__{destinationChannelId}`.
227
+ */
228
+ source_channel_id: z
229
+ .string()
230
+ .regex(/^\d+$/, "source_channel_id deve ser o id numérico do canal Chatbee")
231
+ .optional(),
211
232
  /** chatbee_id → platform dept id (or CHANNEL_DEFAULT_DEPT_SENTINEL). */
212
233
  map: z.record(z.string(), z.string().min(1)),
213
234
  });
@@ -222,6 +243,8 @@ export interface IChatbeeImportPubSubEvent {
222
243
  importId: string;
223
244
  tenant: string;
224
245
  destination_channel_id: string;
246
+ /** Canal Chatbee de origem; ausente/null = tenant inteiro. Deve sobreviver às continuações. */
247
+ source_channel_id?: string | null;
225
248
  /** 'analyze' = read-only pass; 'import' = real import. */
226
249
  mode: ChatbeeImportMode;
227
250
  dry_run: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.532",
3
+ "version": "1.3.538",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",