Skip to content

Commit cd45c5c

Browse files
committed
fix(messages): resolve sendMessage conflict merge
1 parent ed38aea commit cd45c5c

2 files changed

Lines changed: 39 additions & 29 deletions

File tree

src/api/dto/sendMessage.dto.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ export class SendReactionDto {
174174
reaction: string;
175175
}
176176

177-
<<<<<<< HEAD
178177
export class CarouselCard {
179178
title?: string;
180179
body: string;
@@ -186,7 +185,8 @@ export class CarouselCard {
186185
export class SendCarouselDto extends Metadata {
187186
body: string;
188187
cards: CarouselCard[];
189-
=======
188+
}
189+
190190
export class SendProductDto extends Metadata {
191191
/** WhatsApp internal product id (from /business/getCatalog `id`) */
192192
productId: string;
@@ -210,5 +210,4 @@ export class SendProductDto extends Metadata {
210210
productImageCount?: number;
211211
/** Optional caption sent alongside the product card. */
212212
caption?: string;
213-
>>>>>>> 97a314b9 (feat(messages): add sendProduct endpoint for WhatsApp Business catalog cards)
214213
}

src/validate/message.schema.ts

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -457,16 +457,11 @@ export const buttonsMessageSchema: JSONSchema7 = {
457457
required: ['number'],
458458
};
459459

460-
<<<<<<< HEAD
461460
export const carouselMessageSchema: JSONSchema7 = {
462-
=======
463-
export const productMessageSchema: JSONSchema7 = {
464-
>>>>>>> 97a314b9 (feat(messages): add sendProduct endpoint for WhatsApp Business catalog cards)
465461
$id: v4(),
466462
type: 'object',
467463
properties: {
468464
number: { ...numberDefinition },
469-
<<<<<<< HEAD
470465
body: { type: 'string', minLength: 1 },
471466
cards: {
472467
type: 'array',
@@ -486,7 +481,7 @@ export const productMessageSchema: JSONSchema7 = {
486481
items: {
487482
type: 'object',
488483
properties: {
489-
type: { type: 'string', enum: ['reply', 'copy', 'url', 'call'] },
484+
type: { type: 'string', enum: ['reply', 'copy', 'url', 'call', 'pix'] },
490485
displayText: { type: 'string' },
491486
id: { type: 'string' },
492487
url: { type: 'string' },
@@ -506,7 +501,7 @@ export const productMessageSchema: JSONSchema7 = {
506501
description: 'Enter a value in milliseconds',
507502
},
508503
quoted: { ...quotedOptionsSchema },
509-
everyOne: { type: 'boolean', enum: [true, false] },
504+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
510505
mentioned: {
511506
type: 'array',
512507
minItems: 1,
@@ -521,27 +516,11 @@ export const productMessageSchema: JSONSchema7 = {
521516
required: ['number', 'body', 'cards'],
522517
};
523518

524-
export const decryptPollVoteSchema: JSONSchema7 = {
519+
export const productMessageSchema: JSONSchema7 = {
525520
$id: v4(),
526521
type: 'object',
527522
properties: {
528-
message: {
529-
type: 'object',
530-
properties: {
531-
key: {
532-
type: 'object',
533-
properties: {
534-
id: { type: 'string' },
535-
},
536-
required: ['id'],
537-
},
538-
},
539-
required: ['key'],
540-
},
541-
remoteJid: { type: 'string' },
542-
},
543-
required: ['message', 'remoteJid'],
544-
=======
523+
number: { ...numberDefinition },
545524
productId: { type: 'string', minLength: 1 },
546525
businessOwnerJid: {
547526
type: 'string',
@@ -559,8 +538,40 @@ export const decryptPollVoteSchema: JSONSchema7 = {
559538
caption: { type: 'string' },
560539
delay: { type: 'integer', description: 'Enter a value in milliseconds' },
561540
quoted: { ...quotedOptionsSchema },
541+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
542+
mentioned: {
543+
type: 'array',
544+
minItems: 1,
545+
uniqueItems: true,
546+
items: {
547+
type: 'string',
548+
pattern: '^\\d+',
549+
description: '"mentioned" must be an array of numeric strings',
550+
},
551+
},
562552
},
563553
required: ['number', 'productId', 'businessOwnerJid', 'productImage'],
564554
...isNotEmpty('number', 'productId', 'businessOwnerJid', 'productImage'),
565-
>>>>>>> 97a314b9 (feat(messages): add sendProduct endpoint for WhatsApp Business catalog cards)
555+
};
556+
557+
export const decryptPollVoteSchema: JSONSchema7 = {
558+
$id: v4(),
559+
type: 'object',
560+
properties: {
561+
message: {
562+
type: 'object',
563+
properties: {
564+
key: {
565+
type: 'object',
566+
properties: {
567+
id: { type: 'string' },
568+
},
569+
required: ['id'],
570+
},
571+
},
572+
required: ['key'],
573+
},
574+
remoteJid: { type: 'string' },
575+
},
576+
required: ['message', 'remoteJid'],
566577
};

0 commit comments

Comments
 (0)