@itsliaaa/baileys 0.1.9 → 0.1.11

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/WAProto/index.js CHANGED
@@ -6766,6 +6766,10 @@ export const proto = $root.proto = (() => {
6766
6766
  case 60:
6767
6767
  m.capabilities[i] = 60;
6768
6768
  break;
6769
+ case "AI_SUBSCRIPTION_ENABLED":
6770
+ case 61:
6771
+ m.capabilities[i] = 61;
6772
+ break;
6769
6773
  }
6770
6774
  }
6771
6775
  }
@@ -6862,6 +6866,7 @@ export const proto = $root.proto = (() => {
6862
6866
  values[valuesById[58] = "JSON_PATCH_STREAMING"] = 58;
6863
6867
  values[valuesById[59] = "AI_TAB_FORCE_CLIPPY"] = 59;
6864
6868
  values[valuesById[60] = "UNIFIED_RESPONSE_EMBEDDED_SCREENS"] = 60;
6869
+ values[valuesById[61] = "AI_SUBSCRIPTION_ENABLED"] = 61;
6865
6870
  return values;
6866
6871
  })();
6867
6872
 
@@ -17539,10 +17544,32 @@ export const proto = $root.proto = (() => {
17539
17544
  this[ks[i]] = p[ks[i]];
17540
17545
  }
17541
17546
 
17542
- Citation.prototype.title = "";
17543
- Citation.prototype.subtitle = "";
17544
- Citation.prototype.cmsId = "";
17545
- Citation.prototype.imageUrl = "";
17547
+ Citation.prototype.title = null;
17548
+ Citation.prototype.subtitle = null;
17549
+ Citation.prototype.cmsId = null;
17550
+ Citation.prototype.imageUrl = null;
17551
+
17552
+ let $oneOfFields;
17553
+
17554
+ Object.defineProperty(Citation.prototype, "_title", {
17555
+ get: $util.oneOfGetter($oneOfFields = ["title"]),
17556
+ set: $util.oneOfSetter($oneOfFields)
17557
+ });
17558
+
17559
+ Object.defineProperty(Citation.prototype, "_subtitle", {
17560
+ get: $util.oneOfGetter($oneOfFields = ["subtitle"]),
17561
+ set: $util.oneOfSetter($oneOfFields)
17562
+ });
17563
+
17564
+ Object.defineProperty(Citation.prototype, "_cmsId", {
17565
+ get: $util.oneOfGetter($oneOfFields = ["cmsId"]),
17566
+ set: $util.oneOfSetter($oneOfFields)
17567
+ });
17568
+
17569
+ Object.defineProperty(Citation.prototype, "_imageUrl", {
17570
+ get: $util.oneOfGetter($oneOfFields = ["imageUrl"]),
17571
+ set: $util.oneOfSetter($oneOfFields)
17572
+ });
17546
17573
 
17547
17574
  Citation.create = function create(properties) {
17548
17575
  return new Citation(properties);
@@ -17618,23 +17645,25 @@ export const proto = $root.proto = (() => {
17618
17645
  if (!o)
17619
17646
  o = {};
17620
17647
  var d = {};
17621
- if (o.defaults) {
17622
- d.title = "";
17623
- d.subtitle = "";
17624
- d.cmsId = "";
17625
- d.imageUrl = "";
17626
- }
17627
17648
  if (m.title != null && m.hasOwnProperty("title")) {
17628
17649
  d.title = m.title;
17650
+ if (o.oneofs)
17651
+ d._title = "title";
17629
17652
  }
17630
17653
  if (m.subtitle != null && m.hasOwnProperty("subtitle")) {
17631
17654
  d.subtitle = m.subtitle;
17655
+ if (o.oneofs)
17656
+ d._subtitle = "subtitle";
17632
17657
  }
17633
17658
  if (m.cmsId != null && m.hasOwnProperty("cmsId")) {
17634
17659
  d.cmsId = m.cmsId;
17660
+ if (o.oneofs)
17661
+ d._cmsId = "cmsId";
17635
17662
  }
17636
17663
  if (m.imageUrl != null && m.hasOwnProperty("imageUrl")) {
17637
17664
  d.imageUrl = m.imageUrl;
17665
+ if (o.oneofs)
17666
+ d._imageUrl = "imageUrl";
17638
17667
  }
17639
17668
  return d;
17640
17669
  };
@@ -31803,6 +31832,7 @@ export const proto = $root.proto = (() => {
31803
31832
  ClientHello.prototype.paddedBytes = null;
31804
31833
  ClientHello.prototype.sendServerHelloPaddedBytes = null;
31805
31834
  ClientHello.prototype.simulateXxkemFs = null;
31835
+ ClientHello.prototype.pqMode = null;
31806
31836
 
31807
31837
  let $oneOfFields;
31808
31838
 
@@ -31846,6 +31876,11 @@ export const proto = $root.proto = (() => {
31846
31876
  set: $util.oneOfSetter($oneOfFields)
31847
31877
  });
31848
31878
 
31879
+ Object.defineProperty(ClientHello.prototype, "_pqMode", {
31880
+ get: $util.oneOfGetter($oneOfFields = ["pqMode"]),
31881
+ set: $util.oneOfSetter($oneOfFields)
31882
+ });
31883
+
31849
31884
  ClientHello.create = function create(properties) {
31850
31885
  return new ClientHello(properties);
31851
31886
  };
@@ -31869,6 +31904,8 @@ export const proto = $root.proto = (() => {
31869
31904
  w.uint32(56).bool(m.sendServerHelloPaddedBytes);
31870
31905
  if (m.simulateXxkemFs != null && Object.hasOwnProperty.call(m, "simulateXxkemFs"))
31871
31906
  w.uint32(64).bool(m.simulateXxkemFs);
31907
+ if (m.pqMode != null && Object.hasOwnProperty.call(m, "pqMode"))
31908
+ w.uint32(72).int32(m.pqMode);
31872
31909
  return w;
31873
31910
  };
31874
31911
 
@@ -31913,6 +31950,10 @@ export const proto = $root.proto = (() => {
31913
31950
  m.simulateXxkemFs = r.bool();
31914
31951
  break;
31915
31952
  }
31953
+ case 9: {
31954
+ m.pqMode = r.int32();
31955
+ break;
31956
+ }
31916
31957
  default:
31917
31958
  r.skipType(t & 7);
31918
31959
  break;
@@ -31964,6 +32005,50 @@ export const proto = $root.proto = (() => {
31964
32005
  if (d.simulateXxkemFs != null) {
31965
32006
  m.simulateXxkemFs = Boolean(d.simulateXxkemFs);
31966
32007
  }
32008
+ switch (d.pqMode) {
32009
+ default:
32010
+ if (typeof d.pqMode === "number") {
32011
+ m.pqMode = d.pqMode;
32012
+ break;
32013
+ }
32014
+ break;
32015
+ case "HANDSHAKE_PQ_MODE_UNKNOWN":
32016
+ case 0:
32017
+ m.pqMode = 0;
32018
+ break;
32019
+ case "XXKEM":
32020
+ case 1:
32021
+ m.pqMode = 1;
32022
+ break;
32023
+ case "XXKEM_FS":
32024
+ case 2:
32025
+ m.pqMode = 2;
32026
+ break;
32027
+ case "WA_CLASSICAL":
32028
+ case 3:
32029
+ m.pqMode = 3;
32030
+ break;
32031
+ case "WA_PQ":
32032
+ case 4:
32033
+ m.pqMode = 4;
32034
+ break;
32035
+ case "IKKEM":
32036
+ case 5:
32037
+ m.pqMode = 5;
32038
+ break;
32039
+ case "IKKEM_FS":
32040
+ case 6:
32041
+ m.pqMode = 6;
32042
+ break;
32043
+ case "XXKEM_2":
32044
+ case 7:
32045
+ m.pqMode = 7;
32046
+ break;
32047
+ case "IKKEM_2":
32048
+ case 8:
32049
+ m.pqMode = 8;
32050
+ break;
32051
+ }
31967
32052
  return m;
31968
32053
  };
31969
32054
 
@@ -32011,6 +32096,11 @@ export const proto = $root.proto = (() => {
32011
32096
  if (o.oneofs)
32012
32097
  d._simulateXxkemFs = "simulateXxkemFs";
32013
32098
  }
32099
+ if (m.pqMode != null && m.hasOwnProperty("pqMode")) {
32100
+ d.pqMode = o.enums === String ? $root.proto.HandshakeMessage.HandshakePqMode[m.pqMode] === undefined ? m.pqMode : $root.proto.HandshakeMessage.HandshakePqMode[m.pqMode] : m.pqMode;
32101
+ if (o.oneofs)
32102
+ d._pqMode = "pqMode";
32103
+ }
32014
32104
  return d;
32015
32105
  };
32016
32106
 
@@ -32028,6 +32118,20 @@ export const proto = $root.proto = (() => {
32028
32118
  return ClientHello;
32029
32119
  })();
32030
32120
 
32121
+ HandshakeMessage.HandshakePqMode = (function() {
32122
+ const valuesById = {}, values = Object.create(valuesById);
32123
+ values[valuesById[0] = "HANDSHAKE_PQ_MODE_UNKNOWN"] = 0;
32124
+ values[valuesById[1] = "XXKEM"] = 1;
32125
+ values[valuesById[2] = "XXKEM_FS"] = 2;
32126
+ values[valuesById[3] = "WA_CLASSICAL"] = 3;
32127
+ values[valuesById[4] = "WA_PQ"] = 4;
32128
+ values[valuesById[5] = "IKKEM"] = 5;
32129
+ values[valuesById[6] = "IKKEM_FS"] = 6;
32130
+ values[valuesById[7] = "XXKEM_2"] = 7;
32131
+ values[valuesById[8] = "IKKEM_2"] = 8;
32132
+ return values;
32133
+ })();
32134
+
32031
32135
  HandshakeMessage.ServerHello = (function() {
32032
32136
 
32033
32137
  function ServerHello(p) {
@@ -68032,10 +68136,32 @@ export const proto = $root.proto = (() => {
68032
68136
  this[ks[i]] = p[ks[i]];
68033
68137
  }
68034
68138
 
68035
- VideoEndCard.prototype.username = "";
68036
- VideoEndCard.prototype.caption = "";
68037
- VideoEndCard.prototype.thumbnailImageUrl = "";
68038
- VideoEndCard.prototype.profilePictureUrl = "";
68139
+ VideoEndCard.prototype.username = null;
68140
+ VideoEndCard.prototype.caption = null;
68141
+ VideoEndCard.prototype.thumbnailImageUrl = null;
68142
+ VideoEndCard.prototype.profilePictureUrl = null;
68143
+
68144
+ let $oneOfFields;
68145
+
68146
+ Object.defineProperty(VideoEndCard.prototype, "_username", {
68147
+ get: $util.oneOfGetter($oneOfFields = ["username"]),
68148
+ set: $util.oneOfSetter($oneOfFields)
68149
+ });
68150
+
68151
+ Object.defineProperty(VideoEndCard.prototype, "_caption", {
68152
+ get: $util.oneOfGetter($oneOfFields = ["caption"]),
68153
+ set: $util.oneOfSetter($oneOfFields)
68154
+ });
68155
+
68156
+ Object.defineProperty(VideoEndCard.prototype, "_thumbnailImageUrl", {
68157
+ get: $util.oneOfGetter($oneOfFields = ["thumbnailImageUrl"]),
68158
+ set: $util.oneOfSetter($oneOfFields)
68159
+ });
68160
+
68161
+ Object.defineProperty(VideoEndCard.prototype, "_profilePictureUrl", {
68162
+ get: $util.oneOfGetter($oneOfFields = ["profilePictureUrl"]),
68163
+ set: $util.oneOfSetter($oneOfFields)
68164
+ });
68039
68165
 
68040
68166
  VideoEndCard.create = function create(properties) {
68041
68167
  return new VideoEndCard(properties);
@@ -68111,23 +68237,25 @@ export const proto = $root.proto = (() => {
68111
68237
  if (!o)
68112
68238
  o = {};
68113
68239
  var d = {};
68114
- if (o.defaults) {
68115
- d.username = "";
68116
- d.caption = "";
68117
- d.thumbnailImageUrl = "";
68118
- d.profilePictureUrl = "";
68119
- }
68120
68240
  if (m.username != null && m.hasOwnProperty("username")) {
68121
68241
  d.username = m.username;
68242
+ if (o.oneofs)
68243
+ d._username = "username";
68122
68244
  }
68123
68245
  if (m.caption != null && m.hasOwnProperty("caption")) {
68124
68246
  d.caption = m.caption;
68247
+ if (o.oneofs)
68248
+ d._caption = "caption";
68125
68249
  }
68126
68250
  if (m.thumbnailImageUrl != null && m.hasOwnProperty("thumbnailImageUrl")) {
68127
68251
  d.thumbnailImageUrl = m.thumbnailImageUrl;
68252
+ if (o.oneofs)
68253
+ d._thumbnailImageUrl = "thumbnailImageUrl";
68128
68254
  }
68129
68255
  if (m.profilePictureUrl != null && m.hasOwnProperty("profilePictureUrl")) {
68130
68256
  d.profilePictureUrl = m.profilePictureUrl;
68257
+ if (o.oneofs)
68258
+ d._profilePictureUrl = "profilePictureUrl";
68131
68259
  }
68132
68260
  return d;
68133
68261
  };
@@ -86114,11 +86242,28 @@ export const proto = $root.proto = (() => {
86114
86242
  this[ks[i]] = p[ks[i]];
86115
86243
  }
86116
86244
 
86117
- CustomPaymentMethod.prototype.credentialId = "";
86118
- CustomPaymentMethod.prototype.country = "";
86119
- CustomPaymentMethod.prototype.type = "";
86245
+ CustomPaymentMethod.prototype.credentialId = null;
86246
+ CustomPaymentMethod.prototype.country = null;
86247
+ CustomPaymentMethod.prototype.type = null;
86120
86248
  CustomPaymentMethod.prototype.metadata = $util.emptyArray;
86121
86249
 
86250
+ let $oneOfFields;
86251
+
86252
+ Object.defineProperty(CustomPaymentMethod.prototype, "_credentialId", {
86253
+ get: $util.oneOfGetter($oneOfFields = ["credentialId"]),
86254
+ set: $util.oneOfSetter($oneOfFields)
86255
+ });
86256
+
86257
+ Object.defineProperty(CustomPaymentMethod.prototype, "_country", {
86258
+ get: $util.oneOfGetter($oneOfFields = ["country"]),
86259
+ set: $util.oneOfSetter($oneOfFields)
86260
+ });
86261
+
86262
+ Object.defineProperty(CustomPaymentMethod.prototype, "_type", {
86263
+ get: $util.oneOfGetter($oneOfFields = ["type"]),
86264
+ set: $util.oneOfSetter($oneOfFields)
86265
+ });
86266
+
86122
86267
  CustomPaymentMethod.create = function create(properties) {
86123
86268
  return new CustomPaymentMethod(properties);
86124
86269
  };
@@ -86207,19 +86352,20 @@ export const proto = $root.proto = (() => {
86207
86352
  if (o.arrays || o.defaults) {
86208
86353
  d.metadata = [];
86209
86354
  }
86210
- if (o.defaults) {
86211
- d.credentialId = "";
86212
- d.country = "";
86213
- d.type = "";
86214
- }
86215
86355
  if (m.credentialId != null && m.hasOwnProperty("credentialId")) {
86216
86356
  d.credentialId = m.credentialId;
86357
+ if (o.oneofs)
86358
+ d._credentialId = "credentialId";
86217
86359
  }
86218
86360
  if (m.country != null && m.hasOwnProperty("country")) {
86219
86361
  d.country = m.country;
86362
+ if (o.oneofs)
86363
+ d._country = "country";
86220
86364
  }
86221
86365
  if (m.type != null && m.hasOwnProperty("type")) {
86222
86366
  d.type = m.type;
86367
+ if (o.oneofs)
86368
+ d._type = "type";
86223
86369
  }
86224
86370
  if (m.metadata && m.metadata.length) {
86225
86371
  d.metadata = [];
@@ -86253,8 +86399,20 @@ export const proto = $root.proto = (() => {
86253
86399
  this[ks[i]] = p[ks[i]];
86254
86400
  }
86255
86401
 
86256
- CustomPaymentMethodMetadata.prototype.key = "";
86257
- CustomPaymentMethodMetadata.prototype.value = "";
86402
+ CustomPaymentMethodMetadata.prototype.key = null;
86403
+ CustomPaymentMethodMetadata.prototype.value = null;
86404
+
86405
+ let $oneOfFields;
86406
+
86407
+ Object.defineProperty(CustomPaymentMethodMetadata.prototype, "_key", {
86408
+ get: $util.oneOfGetter($oneOfFields = ["key"]),
86409
+ set: $util.oneOfSetter($oneOfFields)
86410
+ });
86411
+
86412
+ Object.defineProperty(CustomPaymentMethodMetadata.prototype, "_value", {
86413
+ get: $util.oneOfGetter($oneOfFields = ["value"]),
86414
+ set: $util.oneOfSetter($oneOfFields)
86415
+ });
86258
86416
 
86259
86417
  CustomPaymentMethodMetadata.create = function create(properties) {
86260
86418
  return new CustomPaymentMethodMetadata(properties);
@@ -86312,15 +86470,15 @@ export const proto = $root.proto = (() => {
86312
86470
  if (!o)
86313
86471
  o = {};
86314
86472
  var d = {};
86315
- if (o.defaults) {
86316
- d.key = "";
86317
- d.value = "";
86318
- }
86319
86473
  if (m.key != null && m.hasOwnProperty("key")) {
86320
86474
  d.key = m.key;
86475
+ if (o.oneofs)
86476
+ d._key = "key";
86321
86477
  }
86322
86478
  if (m.value != null && m.hasOwnProperty("value")) {
86323
86479
  d.value = m.value;
86480
+ if (o.oneofs)
86481
+ d._value = "value";
86324
86482
  }
86325
86483
  return d;
86326
86484
  };
@@ -87441,11 +87599,16 @@ export const proto = $root.proto = (() => {
87441
87599
  this[ks[i]] = p[ks[i]];
87442
87600
  }
87443
87601
 
87444
- InteractiveMessageAction.prototype.type = 1;
87602
+ InteractiveMessageAction.prototype.type = null;
87445
87603
  InteractiveMessageAction.prototype.agmId = null;
87446
87604
 
87447
87605
  let $oneOfFields;
87448
87606
 
87607
+ Object.defineProperty(InteractiveMessageAction.prototype, "_type", {
87608
+ get: $util.oneOfGetter($oneOfFields = ["type"]),
87609
+ set: $util.oneOfSetter($oneOfFields)
87610
+ });
87611
+
87449
87612
  Object.defineProperty(InteractiveMessageAction.prototype, "_agmId", {
87450
87613
  get: $util.oneOfGetter($oneOfFields = ["agmId"]),
87451
87614
  set: $util.oneOfSetter($oneOfFields)
@@ -87516,11 +87679,10 @@ export const proto = $root.proto = (() => {
87516
87679
  if (!o)
87517
87680
  o = {};
87518
87681
  var d = {};
87519
- if (o.defaults) {
87520
- d.type = o.enums === String ? "DISABLE_CTA" : 1;
87521
- }
87522
87682
  if (m.type != null && m.hasOwnProperty("type")) {
87523
87683
  d.type = o.enums === String ? $root.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[m.type] === undefined ? m.type : $root.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[m.type] : m.type;
87684
+ if (o.oneofs)
87685
+ d._type = "type";
87524
87686
  }
87525
87687
  if (m.agmId != null && m.hasOwnProperty("agmId")) {
87526
87688
  d.agmId = m.agmId;
@@ -89007,13 +89169,23 @@ export const proto = $root.proto = (() => {
89007
89169
  this[ks[i]] = p[ks[i]];
89008
89170
  }
89009
89171
 
89010
- MerchantPaymentPartnerAction.prototype.status = 0;
89011
- MerchantPaymentPartnerAction.prototype.country = "";
89172
+ MerchantPaymentPartnerAction.prototype.status = null;
89173
+ MerchantPaymentPartnerAction.prototype.country = null;
89012
89174
  MerchantPaymentPartnerAction.prototype.gatewayName = null;
89013
89175
  MerchantPaymentPartnerAction.prototype.credentialId = null;
89014
89176
 
89015
89177
  let $oneOfFields;
89016
89178
 
89179
+ Object.defineProperty(MerchantPaymentPartnerAction.prototype, "_status", {
89180
+ get: $util.oneOfGetter($oneOfFields = ["status"]),
89181
+ set: $util.oneOfSetter($oneOfFields)
89182
+ });
89183
+
89184
+ Object.defineProperty(MerchantPaymentPartnerAction.prototype, "_country", {
89185
+ get: $util.oneOfGetter($oneOfFields = ["country"]),
89186
+ set: $util.oneOfSetter($oneOfFields)
89187
+ });
89188
+
89017
89189
  Object.defineProperty(MerchantPaymentPartnerAction.prototype, "_gatewayName", {
89018
89190
  get: $util.oneOfGetter($oneOfFields = ["gatewayName"]),
89019
89191
  set: $util.oneOfSetter($oneOfFields)
@@ -89111,15 +89283,15 @@ export const proto = $root.proto = (() => {
89111
89283
  if (!o)
89112
89284
  o = {};
89113
89285
  var d = {};
89114
- if (o.defaults) {
89115
- d.status = o.enums === String ? "ACTIVE" : 0;
89116
- d.country = "";
89117
- }
89118
89286
  if (m.status != null && m.hasOwnProperty("status")) {
89119
89287
  d.status = o.enums === String ? $root.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[m.status] === undefined ? m.status : $root.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[m.status] : m.status;
89288
+ if (o.oneofs)
89289
+ d._status = "status";
89120
89290
  }
89121
89291
  if (m.country != null && m.hasOwnProperty("country")) {
89122
89292
  d.country = m.country;
89293
+ if (o.oneofs)
89294
+ d._country = "country";
89123
89295
  }
89124
89296
  if (m.gatewayName != null && m.hasOwnProperty("gatewayName")) {
89125
89297
  d.gatewayName = m.gatewayName;
@@ -90238,8 +90410,20 @@ export const proto = $root.proto = (() => {
90238
90410
  this[ks[i]] = p[ks[i]];
90239
90411
  }
90240
90412
 
90241
- PaymentTosAction.prototype.paymentNotice = 0;
90242
- PaymentTosAction.prototype.accepted = false;
90413
+ PaymentTosAction.prototype.paymentNotice = null;
90414
+ PaymentTosAction.prototype.accepted = null;
90415
+
90416
+ let $oneOfFields;
90417
+
90418
+ Object.defineProperty(PaymentTosAction.prototype, "_paymentNotice", {
90419
+ get: $util.oneOfGetter($oneOfFields = ["paymentNotice"]),
90420
+ set: $util.oneOfSetter($oneOfFields)
90421
+ });
90422
+
90423
+ Object.defineProperty(PaymentTosAction.prototype, "_accepted", {
90424
+ get: $util.oneOfGetter($oneOfFields = ["accepted"]),
90425
+ set: $util.oneOfSetter($oneOfFields)
90426
+ });
90243
90427
 
90244
90428
  PaymentTosAction.create = function create(properties) {
90245
90429
  return new PaymentTosAction(properties);
@@ -90306,15 +90490,15 @@ export const proto = $root.proto = (() => {
90306
90490
  if (!o)
90307
90491
  o = {};
90308
90492
  var d = {};
90309
- if (o.defaults) {
90310
- d.paymentNotice = o.enums === String ? "BR_PAY_PRIVACY_POLICY" : 0;
90311
- d.accepted = false;
90312
- }
90313
90493
  if (m.paymentNotice != null && m.hasOwnProperty("paymentNotice")) {
90314
90494
  d.paymentNotice = o.enums === String ? $root.proto.SyncActionValue.PaymentTosAction.PaymentNotice[m.paymentNotice] === undefined ? m.paymentNotice : $root.proto.SyncActionValue.PaymentTosAction.PaymentNotice[m.paymentNotice] : m.paymentNotice;
90495
+ if (o.oneofs)
90496
+ d._paymentNotice = "paymentNotice";
90315
90497
  }
90316
90498
  if (m.accepted != null && m.hasOwnProperty("accepted")) {
90317
90499
  d.accepted = m.accepted;
90500
+ if (o.oneofs)
90501
+ d._accepted = "accepted";
90318
90502
  }
90319
90503
  return d;
90320
90504
  };
@@ -138,15 +138,24 @@ const DECISION_SOURCE_CONTENT = [
138
138
  attrs: { value: 'df' }
139
139
  }
140
140
  ];
141
- const MIXED_NATIVE_FLOW = [
142
- {
143
- tag: 'native_flow',
144
- attrs: { v: '9', name: 'mixed' }
145
- }
146
- ];
141
+ const LIST_TYPE_CONTENT = {
142
+ tag: 'list',
143
+ attrs: { v: '2', type: 'product_list' }
144
+ };
145
+ const NATIVE_FLOW_ATTRIBUTE = { type: 'native_flow', v: '1' };
146
+ const MIXED_NATIVE_FLOW = {
147
+ tag: 'interactive',
148
+ attrs: NATIVE_FLOW_ATTRIBUTE,
149
+ content: [
150
+ {
151
+ tag: 'native_flow',
152
+ attrs: { v: '9', name: 'mixed' }
153
+ }
154
+ ]
155
+ };
147
156
  export const getBizBinaryNode = (message) => {
148
157
  const flowMsg = message.interactiveMessage?.nativeFlowMessage;
149
- const buttonName = flowMsg?.buttons?.[0]?.name;
158
+ const firstButtonName = flowMsg?.buttons?.[0]?.name;
150
159
  const qualityContent = {
151
160
  tag: 'quality_control',
152
161
  attrs: {
@@ -154,30 +163,30 @@ export const getBizBinaryNode = (message) => {
154
163
  source_type: 'third_party'
155
164
  },
156
165
  content: DECISION_SOURCE_CONTENT
157
- }
158
- if (buttonName === 'review_and_pay' || buttonName === 'payment_info') {
166
+ };
167
+ if (firstButtonName === 'review_and_pay' || firstButtonName === 'payment_info') {
159
168
  return {
160
169
  tag: 'biz',
161
170
  attrs: {
162
- native_flow_name: buttonName === 'review_and_pay' ?
171
+ native_flow_name: firstButtonName === 'review_and_pay' ?
163
172
  'order_details' :
164
- buttonName
173
+ firstButtonName
165
174
  },
166
175
  content: [qualityContent]
167
176
  };
168
177
  }
169
- if (buttonName && FLOWS_MAP[buttonName]) {
178
+ if (firstButtonName && FLOWS_MAP[firstButtonName]) {
170
179
  return {
171
180
  tag: 'biz',
172
181
  attrs: {},
173
182
  content: [
174
183
  {
175
184
  tag: 'interactive',
176
- attrs: { type: 'native_flow', v: '1' },
185
+ attrs: NATIVE_FLOW_ATTRIBUTE,
177
186
  content: [
178
187
  {
179
188
  tag: 'native_flow',
180
- attrs: { v: '2', name: buttonName }
189
+ attrs: { v: '2', name: firstButtonName }
181
190
  }
182
191
  ]
183
192
  },
@@ -190,11 +199,7 @@ export const getBizBinaryNode = (message) => {
190
199
  tag: 'biz',
191
200
  attrs: {},
192
201
  content: [
193
- {
194
- tag: 'interactive',
195
- attrs: { type: 'native_flow', v: '1' },
196
- content: MIXED_NATIVE_FLOW
197
- },
202
+ MIXED_NATIVE_FLOW,
198
203
  qualityContent
199
204
  ]
200
205
  };
@@ -204,10 +209,7 @@ export const getBizBinaryNode = (message) => {
204
209
  tag: 'biz',
205
210
  attrs: {},
206
211
  content: [
207
- {
208
- tag: 'list',
209
- attrs: { v: '2', type: 'product_list' }
210
- },
212
+ LIST_TYPE_CONTENT,
211
213
  qualityContent
212
214
  ]
213
215
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itsliaaa/baileys",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "A simple fork of Baileys for WhatsApp automation",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",