@itsliaaa/baileys 0.1.9 → 0.1.10

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
@@ -17539,10 +17539,32 @@ export const proto = $root.proto = (() => {
17539
17539
  this[ks[i]] = p[ks[i]];
17540
17540
  }
17541
17541
 
17542
- Citation.prototype.title = "";
17543
- Citation.prototype.subtitle = "";
17544
- Citation.prototype.cmsId = "";
17545
- Citation.prototype.imageUrl = "";
17542
+ Citation.prototype.title = null;
17543
+ Citation.prototype.subtitle = null;
17544
+ Citation.prototype.cmsId = null;
17545
+ Citation.prototype.imageUrl = null;
17546
+
17547
+ let $oneOfFields;
17548
+
17549
+ Object.defineProperty(Citation.prototype, "_title", {
17550
+ get: $util.oneOfGetter($oneOfFields = ["title"]),
17551
+ set: $util.oneOfSetter($oneOfFields)
17552
+ });
17553
+
17554
+ Object.defineProperty(Citation.prototype, "_subtitle", {
17555
+ get: $util.oneOfGetter($oneOfFields = ["subtitle"]),
17556
+ set: $util.oneOfSetter($oneOfFields)
17557
+ });
17558
+
17559
+ Object.defineProperty(Citation.prototype, "_cmsId", {
17560
+ get: $util.oneOfGetter($oneOfFields = ["cmsId"]),
17561
+ set: $util.oneOfSetter($oneOfFields)
17562
+ });
17563
+
17564
+ Object.defineProperty(Citation.prototype, "_imageUrl", {
17565
+ get: $util.oneOfGetter($oneOfFields = ["imageUrl"]),
17566
+ set: $util.oneOfSetter($oneOfFields)
17567
+ });
17546
17568
 
17547
17569
  Citation.create = function create(properties) {
17548
17570
  return new Citation(properties);
@@ -17618,23 +17640,25 @@ export const proto = $root.proto = (() => {
17618
17640
  if (!o)
17619
17641
  o = {};
17620
17642
  var d = {};
17621
- if (o.defaults) {
17622
- d.title = "";
17623
- d.subtitle = "";
17624
- d.cmsId = "";
17625
- d.imageUrl = "";
17626
- }
17627
17643
  if (m.title != null && m.hasOwnProperty("title")) {
17628
17644
  d.title = m.title;
17645
+ if (o.oneofs)
17646
+ d._title = "title";
17629
17647
  }
17630
17648
  if (m.subtitle != null && m.hasOwnProperty("subtitle")) {
17631
17649
  d.subtitle = m.subtitle;
17650
+ if (o.oneofs)
17651
+ d._subtitle = "subtitle";
17632
17652
  }
17633
17653
  if (m.cmsId != null && m.hasOwnProperty("cmsId")) {
17634
17654
  d.cmsId = m.cmsId;
17655
+ if (o.oneofs)
17656
+ d._cmsId = "cmsId";
17635
17657
  }
17636
17658
  if (m.imageUrl != null && m.hasOwnProperty("imageUrl")) {
17637
17659
  d.imageUrl = m.imageUrl;
17660
+ if (o.oneofs)
17661
+ d._imageUrl = "imageUrl";
17638
17662
  }
17639
17663
  return d;
17640
17664
  };
@@ -31803,6 +31827,7 @@ export const proto = $root.proto = (() => {
31803
31827
  ClientHello.prototype.paddedBytes = null;
31804
31828
  ClientHello.prototype.sendServerHelloPaddedBytes = null;
31805
31829
  ClientHello.prototype.simulateXxkemFs = null;
31830
+ ClientHello.prototype.pqMode = null;
31806
31831
 
31807
31832
  let $oneOfFields;
31808
31833
 
@@ -31846,6 +31871,11 @@ export const proto = $root.proto = (() => {
31846
31871
  set: $util.oneOfSetter($oneOfFields)
31847
31872
  });
31848
31873
 
31874
+ Object.defineProperty(ClientHello.prototype, "_pqMode", {
31875
+ get: $util.oneOfGetter($oneOfFields = ["pqMode"]),
31876
+ set: $util.oneOfSetter($oneOfFields)
31877
+ });
31878
+
31849
31879
  ClientHello.create = function create(properties) {
31850
31880
  return new ClientHello(properties);
31851
31881
  };
@@ -31869,6 +31899,8 @@ export const proto = $root.proto = (() => {
31869
31899
  w.uint32(56).bool(m.sendServerHelloPaddedBytes);
31870
31900
  if (m.simulateXxkemFs != null && Object.hasOwnProperty.call(m, "simulateXxkemFs"))
31871
31901
  w.uint32(64).bool(m.simulateXxkemFs);
31902
+ if (m.pqMode != null && Object.hasOwnProperty.call(m, "pqMode"))
31903
+ w.uint32(72).int32(m.pqMode);
31872
31904
  return w;
31873
31905
  };
31874
31906
 
@@ -31913,6 +31945,10 @@ export const proto = $root.proto = (() => {
31913
31945
  m.simulateXxkemFs = r.bool();
31914
31946
  break;
31915
31947
  }
31948
+ case 9: {
31949
+ m.pqMode = r.int32();
31950
+ break;
31951
+ }
31916
31952
  default:
31917
31953
  r.skipType(t & 7);
31918
31954
  break;
@@ -31964,6 +32000,50 @@ export const proto = $root.proto = (() => {
31964
32000
  if (d.simulateXxkemFs != null) {
31965
32001
  m.simulateXxkemFs = Boolean(d.simulateXxkemFs);
31966
32002
  }
32003
+ switch (d.pqMode) {
32004
+ default:
32005
+ if (typeof d.pqMode === "number") {
32006
+ m.pqMode = d.pqMode;
32007
+ break;
32008
+ }
32009
+ break;
32010
+ case "HANDSHAKE_PQ_MODE_UNKNOWN":
32011
+ case 0:
32012
+ m.pqMode = 0;
32013
+ break;
32014
+ case "XXKEM":
32015
+ case 1:
32016
+ m.pqMode = 1;
32017
+ break;
32018
+ case "XXKEM_FS":
32019
+ case 2:
32020
+ m.pqMode = 2;
32021
+ break;
32022
+ case "WA_CLASSICAL":
32023
+ case 3:
32024
+ m.pqMode = 3;
32025
+ break;
32026
+ case "WA_PQ":
32027
+ case 4:
32028
+ m.pqMode = 4;
32029
+ break;
32030
+ case "IKKEM":
32031
+ case 5:
32032
+ m.pqMode = 5;
32033
+ break;
32034
+ case "IKKEM_FS":
32035
+ case 6:
32036
+ m.pqMode = 6;
32037
+ break;
32038
+ case "XXKEM_2":
32039
+ case 7:
32040
+ m.pqMode = 7;
32041
+ break;
32042
+ case "IKKEM_2":
32043
+ case 8:
32044
+ m.pqMode = 8;
32045
+ break;
32046
+ }
31967
32047
  return m;
31968
32048
  };
31969
32049
 
@@ -32011,6 +32091,11 @@ export const proto = $root.proto = (() => {
32011
32091
  if (o.oneofs)
32012
32092
  d._simulateXxkemFs = "simulateXxkemFs";
32013
32093
  }
32094
+ if (m.pqMode != null && m.hasOwnProperty("pqMode")) {
32095
+ d.pqMode = o.enums === String ? $root.proto.HandshakeMessage.HandshakePqMode[m.pqMode] === undefined ? m.pqMode : $root.proto.HandshakeMessage.HandshakePqMode[m.pqMode] : m.pqMode;
32096
+ if (o.oneofs)
32097
+ d._pqMode = "pqMode";
32098
+ }
32014
32099
  return d;
32015
32100
  };
32016
32101
 
@@ -32028,6 +32113,20 @@ export const proto = $root.proto = (() => {
32028
32113
  return ClientHello;
32029
32114
  })();
32030
32115
 
32116
+ HandshakeMessage.HandshakePqMode = (function() {
32117
+ const valuesById = {}, values = Object.create(valuesById);
32118
+ values[valuesById[0] = "HANDSHAKE_PQ_MODE_UNKNOWN"] = 0;
32119
+ values[valuesById[1] = "XXKEM"] = 1;
32120
+ values[valuesById[2] = "XXKEM_FS"] = 2;
32121
+ values[valuesById[3] = "WA_CLASSICAL"] = 3;
32122
+ values[valuesById[4] = "WA_PQ"] = 4;
32123
+ values[valuesById[5] = "IKKEM"] = 5;
32124
+ values[valuesById[6] = "IKKEM_FS"] = 6;
32125
+ values[valuesById[7] = "XXKEM_2"] = 7;
32126
+ values[valuesById[8] = "IKKEM_2"] = 8;
32127
+ return values;
32128
+ })();
32129
+
32031
32130
  HandshakeMessage.ServerHello = (function() {
32032
32131
 
32033
32132
  function ServerHello(p) {
@@ -86114,11 +86213,28 @@ export const proto = $root.proto = (() => {
86114
86213
  this[ks[i]] = p[ks[i]];
86115
86214
  }
86116
86215
 
86117
- CustomPaymentMethod.prototype.credentialId = "";
86118
- CustomPaymentMethod.prototype.country = "";
86119
- CustomPaymentMethod.prototype.type = "";
86216
+ CustomPaymentMethod.prototype.credentialId = null;
86217
+ CustomPaymentMethod.prototype.country = null;
86218
+ CustomPaymentMethod.prototype.type = null;
86120
86219
  CustomPaymentMethod.prototype.metadata = $util.emptyArray;
86121
86220
 
86221
+ let $oneOfFields;
86222
+
86223
+ Object.defineProperty(CustomPaymentMethod.prototype, "_credentialId", {
86224
+ get: $util.oneOfGetter($oneOfFields = ["credentialId"]),
86225
+ set: $util.oneOfSetter($oneOfFields)
86226
+ });
86227
+
86228
+ Object.defineProperty(CustomPaymentMethod.prototype, "_country", {
86229
+ get: $util.oneOfGetter($oneOfFields = ["country"]),
86230
+ set: $util.oneOfSetter($oneOfFields)
86231
+ });
86232
+
86233
+ Object.defineProperty(CustomPaymentMethod.prototype, "_type", {
86234
+ get: $util.oneOfGetter($oneOfFields = ["type"]),
86235
+ set: $util.oneOfSetter($oneOfFields)
86236
+ });
86237
+
86122
86238
  CustomPaymentMethod.create = function create(properties) {
86123
86239
  return new CustomPaymentMethod(properties);
86124
86240
  };
@@ -86207,19 +86323,20 @@ export const proto = $root.proto = (() => {
86207
86323
  if (o.arrays || o.defaults) {
86208
86324
  d.metadata = [];
86209
86325
  }
86210
- if (o.defaults) {
86211
- d.credentialId = "";
86212
- d.country = "";
86213
- d.type = "";
86214
- }
86215
86326
  if (m.credentialId != null && m.hasOwnProperty("credentialId")) {
86216
86327
  d.credentialId = m.credentialId;
86328
+ if (o.oneofs)
86329
+ d._credentialId = "credentialId";
86217
86330
  }
86218
86331
  if (m.country != null && m.hasOwnProperty("country")) {
86219
86332
  d.country = m.country;
86333
+ if (o.oneofs)
86334
+ d._country = "country";
86220
86335
  }
86221
86336
  if (m.type != null && m.hasOwnProperty("type")) {
86222
86337
  d.type = m.type;
86338
+ if (o.oneofs)
86339
+ d._type = "type";
86223
86340
  }
86224
86341
  if (m.metadata && m.metadata.length) {
86225
86342
  d.metadata = [];
@@ -86253,8 +86370,20 @@ export const proto = $root.proto = (() => {
86253
86370
  this[ks[i]] = p[ks[i]];
86254
86371
  }
86255
86372
 
86256
- CustomPaymentMethodMetadata.prototype.key = "";
86257
- CustomPaymentMethodMetadata.prototype.value = "";
86373
+ CustomPaymentMethodMetadata.prototype.key = null;
86374
+ CustomPaymentMethodMetadata.prototype.value = null;
86375
+
86376
+ let $oneOfFields;
86377
+
86378
+ Object.defineProperty(CustomPaymentMethodMetadata.prototype, "_key", {
86379
+ get: $util.oneOfGetter($oneOfFields = ["key"]),
86380
+ set: $util.oneOfSetter($oneOfFields)
86381
+ });
86382
+
86383
+ Object.defineProperty(CustomPaymentMethodMetadata.prototype, "_value", {
86384
+ get: $util.oneOfGetter($oneOfFields = ["value"]),
86385
+ set: $util.oneOfSetter($oneOfFields)
86386
+ });
86258
86387
 
86259
86388
  CustomPaymentMethodMetadata.create = function create(properties) {
86260
86389
  return new CustomPaymentMethodMetadata(properties);
@@ -86312,15 +86441,15 @@ export const proto = $root.proto = (() => {
86312
86441
  if (!o)
86313
86442
  o = {};
86314
86443
  var d = {};
86315
- if (o.defaults) {
86316
- d.key = "";
86317
- d.value = "";
86318
- }
86319
86444
  if (m.key != null && m.hasOwnProperty("key")) {
86320
86445
  d.key = m.key;
86446
+ if (o.oneofs)
86447
+ d._key = "key";
86321
86448
  }
86322
86449
  if (m.value != null && m.hasOwnProperty("value")) {
86323
86450
  d.value = m.value;
86451
+ if (o.oneofs)
86452
+ d._value = "value";
86324
86453
  }
86325
86454
  return d;
86326
86455
  };
@@ -87441,11 +87570,16 @@ export const proto = $root.proto = (() => {
87441
87570
  this[ks[i]] = p[ks[i]];
87442
87571
  }
87443
87572
 
87444
- InteractiveMessageAction.prototype.type = 1;
87573
+ InteractiveMessageAction.prototype.type = null;
87445
87574
  InteractiveMessageAction.prototype.agmId = null;
87446
87575
 
87447
87576
  let $oneOfFields;
87448
87577
 
87578
+ Object.defineProperty(InteractiveMessageAction.prototype, "_type", {
87579
+ get: $util.oneOfGetter($oneOfFields = ["type"]),
87580
+ set: $util.oneOfSetter($oneOfFields)
87581
+ });
87582
+
87449
87583
  Object.defineProperty(InteractiveMessageAction.prototype, "_agmId", {
87450
87584
  get: $util.oneOfGetter($oneOfFields = ["agmId"]),
87451
87585
  set: $util.oneOfSetter($oneOfFields)
@@ -87516,11 +87650,10 @@ export const proto = $root.proto = (() => {
87516
87650
  if (!o)
87517
87651
  o = {};
87518
87652
  var d = {};
87519
- if (o.defaults) {
87520
- d.type = o.enums === String ? "DISABLE_CTA" : 1;
87521
- }
87522
87653
  if (m.type != null && m.hasOwnProperty("type")) {
87523
87654
  d.type = o.enums === String ? $root.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[m.type] === undefined ? m.type : $root.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[m.type] : m.type;
87655
+ if (o.oneofs)
87656
+ d._type = "type";
87524
87657
  }
87525
87658
  if (m.agmId != null && m.hasOwnProperty("agmId")) {
87526
87659
  d.agmId = m.agmId;
@@ -89007,13 +89140,23 @@ export const proto = $root.proto = (() => {
89007
89140
  this[ks[i]] = p[ks[i]];
89008
89141
  }
89009
89142
 
89010
- MerchantPaymentPartnerAction.prototype.status = 0;
89011
- MerchantPaymentPartnerAction.prototype.country = "";
89143
+ MerchantPaymentPartnerAction.prototype.status = null;
89144
+ MerchantPaymentPartnerAction.prototype.country = null;
89012
89145
  MerchantPaymentPartnerAction.prototype.gatewayName = null;
89013
89146
  MerchantPaymentPartnerAction.prototype.credentialId = null;
89014
89147
 
89015
89148
  let $oneOfFields;
89016
89149
 
89150
+ Object.defineProperty(MerchantPaymentPartnerAction.prototype, "_status", {
89151
+ get: $util.oneOfGetter($oneOfFields = ["status"]),
89152
+ set: $util.oneOfSetter($oneOfFields)
89153
+ });
89154
+
89155
+ Object.defineProperty(MerchantPaymentPartnerAction.prototype, "_country", {
89156
+ get: $util.oneOfGetter($oneOfFields = ["country"]),
89157
+ set: $util.oneOfSetter($oneOfFields)
89158
+ });
89159
+
89017
89160
  Object.defineProperty(MerchantPaymentPartnerAction.prototype, "_gatewayName", {
89018
89161
  get: $util.oneOfGetter($oneOfFields = ["gatewayName"]),
89019
89162
  set: $util.oneOfSetter($oneOfFields)
@@ -89111,15 +89254,15 @@ export const proto = $root.proto = (() => {
89111
89254
  if (!o)
89112
89255
  o = {};
89113
89256
  var d = {};
89114
- if (o.defaults) {
89115
- d.status = o.enums === String ? "ACTIVE" : 0;
89116
- d.country = "";
89117
- }
89118
89257
  if (m.status != null && m.hasOwnProperty("status")) {
89119
89258
  d.status = o.enums === String ? $root.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[m.status] === undefined ? m.status : $root.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[m.status] : m.status;
89259
+ if (o.oneofs)
89260
+ d._status = "status";
89120
89261
  }
89121
89262
  if (m.country != null && m.hasOwnProperty("country")) {
89122
89263
  d.country = m.country;
89264
+ if (o.oneofs)
89265
+ d._country = "country";
89123
89266
  }
89124
89267
  if (m.gatewayName != null && m.hasOwnProperty("gatewayName")) {
89125
89268
  d.gatewayName = m.gatewayName;
@@ -90238,8 +90381,20 @@ export const proto = $root.proto = (() => {
90238
90381
  this[ks[i]] = p[ks[i]];
90239
90382
  }
90240
90383
 
90241
- PaymentTosAction.prototype.paymentNotice = 0;
90242
- PaymentTosAction.prototype.accepted = false;
90384
+ PaymentTosAction.prototype.paymentNotice = null;
90385
+ PaymentTosAction.prototype.accepted = null;
90386
+
90387
+ let $oneOfFields;
90388
+
90389
+ Object.defineProperty(PaymentTosAction.prototype, "_paymentNotice", {
90390
+ get: $util.oneOfGetter($oneOfFields = ["paymentNotice"]),
90391
+ set: $util.oneOfSetter($oneOfFields)
90392
+ });
90393
+
90394
+ Object.defineProperty(PaymentTosAction.prototype, "_accepted", {
90395
+ get: $util.oneOfGetter($oneOfFields = ["accepted"]),
90396
+ set: $util.oneOfSetter($oneOfFields)
90397
+ });
90243
90398
 
90244
90399
  PaymentTosAction.create = function create(properties) {
90245
90400
  return new PaymentTosAction(properties);
@@ -90306,15 +90461,15 @@ export const proto = $root.proto = (() => {
90306
90461
  if (!o)
90307
90462
  o = {};
90308
90463
  var d = {};
90309
- if (o.defaults) {
90310
- d.paymentNotice = o.enums === String ? "BR_PAY_PRIVACY_POLICY" : 0;
90311
- d.accepted = false;
90312
- }
90313
90464
  if (m.paymentNotice != null && m.hasOwnProperty("paymentNotice")) {
90314
90465
  d.paymentNotice = o.enums === String ? $root.proto.SyncActionValue.PaymentTosAction.PaymentNotice[m.paymentNotice] === undefined ? m.paymentNotice : $root.proto.SyncActionValue.PaymentTosAction.PaymentNotice[m.paymentNotice] : m.paymentNotice;
90466
+ if (o.oneofs)
90467
+ d._paymentNotice = "paymentNotice";
90315
90468
  }
90316
90469
  if (m.accepted != null && m.hasOwnProperty("accepted")) {
90317
90470
  d.accepted = m.accepted;
90471
+ if (o.oneofs)
90472
+ d._accepted = "accepted";
90318
90473
  }
90319
90474
  return d;
90320
90475
  };
@@ -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.10",
4
4
  "description": "A simple fork of Baileys for WhatsApp automation",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",