@wrcb/cb-common 1.0.716 → 1.0.718

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/build/index.d.ts CHANGED
@@ -35,6 +35,7 @@ export * from './types/paymentMethod';
35
35
  export * from './types/paymentStatus';
36
36
  export * from './types/addressType';
37
37
  export * from './types/imageProcessingStatus';
38
+ export * from './types/whatsapp';
38
39
  export * from './types/politicaBetCategory';
39
40
  export * from './types/predictionStatus';
40
41
  export * from './types/disputeStatus';
package/build/index.js CHANGED
@@ -51,6 +51,7 @@ __exportStar(require("./types/paymentMethod"), exports);
51
51
  __exportStar(require("./types/paymentStatus"), exports);
52
52
  __exportStar(require("./types/addressType"), exports);
53
53
  __exportStar(require("./types/imageProcessingStatus"), exports);
54
+ __exportStar(require("./types/whatsapp"), exports);
54
55
  // politicabet
55
56
  __exportStar(require("./types/politicaBetCategory"), exports);
56
57
  __exportStar(require("./types/predictionStatus"), exports);
@@ -3,7 +3,7 @@ export declare class RedisService {
3
3
  static ReturnMinutesInSeconds(minutes: number): number;
4
4
  static ReturnDaysInSeconds(days: number): number;
5
5
  static emailVerificationKey(tenant: Tenant, email: string): string;
6
- static whatsappVerificationKey(tenant: Tenant, email: string): string;
6
+ static whatsappVerificationKey(tenant: Tenant, whatsapp: string): string;
7
7
  static withdrawSettingsKey(tenant: Tenant): string;
8
8
  static maintenanceSettingsKey(tenant: Tenant): string;
9
9
  static userBalanceKey(tenant: Tenant, userId: string): string;
@@ -11,8 +11,8 @@ class RedisService {
11
11
  static emailVerificationKey(tenant, email) {
12
12
  return tenant + ':' + email + ':email:verification';
13
13
  }
14
- static whatsappVerificationKey(tenant, email) {
15
- return tenant + ':' + email + ':whatsapp:verification';
14
+ static whatsappVerificationKey(tenant, whatsapp) {
15
+ return tenant + ':' + whatsapp + ':whatsapp:verification';
16
16
  }
17
17
  static withdrawSettingsKey(tenant) {
18
18
  return tenant + ':withdraw:settings';
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Mensagem recebida do webhook do WhatsApp Business API
3
+ */
4
+ export interface WhatsAppWebhookMessage {
5
+ from: string;
6
+ id: string;
7
+ timestamp: string;
8
+ text?: {
9
+ body: string;
10
+ };
11
+ type?: 'text' | 'image' | 'audio' | 'video' | 'document';
12
+ }
13
+ /**
14
+ * Payload completo do webhook do WhatsApp Business API
15
+ */
16
+ export interface WhatsAppWebhookPayload {
17
+ entry: Array<{
18
+ id: string;
19
+ changes: Array<{
20
+ value: {
21
+ messaging_product: 'whatsapp';
22
+ metadata: {
23
+ display_phone_number: string;
24
+ phone_number_id: string;
25
+ };
26
+ contacts?: Array<{
27
+ profile: {
28
+ name: string;
29
+ };
30
+ wa_id: string;
31
+ }>;
32
+ messages?: WhatsAppWebhookMessage[];
33
+ statuses?: Array<{
34
+ id: string;
35
+ status: 'sent' | 'delivered' | 'read' | 'failed';
36
+ timestamp: string;
37
+ recipient_id: string;
38
+ }>;
39
+ };
40
+ field: string;
41
+ }>;
42
+ }>;
43
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.716",
3
+ "version": "1.0.718",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",