keybase-proofs 2.3.28 → 2.3.29

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.3.29 (2024-07-22)
2
+
3
+ - Fix Twitter scraper to handle empty result list case.
4
+
1
5
  ## 2.3.28 (2024-07-19)
2
6
 
3
7
  - Use version 2 API for X (formerly known as Twitter) hunting.
@@ -133,19 +133,23 @@
133
133
  });
134
134
  })(this)((function(_this) {
135
135
  return function() {
136
- var _i, _len, _ref1, _ref2;
136
+ var _i, _len, _ref1, _ref2, _ref3;
137
137
  _this.log("| search index " + u + " -> " + rc);
138
138
  if (rc !== v_codes.OK) {
139
139
 
140
140
  } else if ((typeof json === "undefined" || json === null) || (json.length === 0)) {
141
141
  rc = v_codes.EMPTY_JSON;
142
142
  } else if (json.data == null) {
143
- rc = v_codes.INVALID_JSON;
143
+ if (((_ref1 = json.meta) != null ? _ref1.result_count : void 0) === 0) {
144
+ rc = v_codes.NOT_FOUND;
145
+ } else {
146
+ rc = v_codes.INVALID_JSON;
147
+ }
144
148
  } else {
145
149
  rc = v_codes.NOT_FOUND;
146
- _ref1 = json.data;
147
- for (i = _i = 0, _len = _ref1.length; _i < _len; i = ++_i) {
148
- _ref2 = _ref1[i], text = _ref2.text, id = _ref2.id;
150
+ _ref2 = json.data;
151
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
152
+ _ref3 = _ref2[i], text = _ref3.text, id = _ref3.id;
149
153
  if ((_this.find_sig_in_tweet({
150
154
  inside: text,
151
155
  proof_text_check: proof_text_check
@@ -231,7 +235,7 @@
231
235
  return json = arguments[2];
232
236
  };
233
237
  })(),
234
- lineno: 123
238
+ lineno: 129
235
239
  }));
236
240
  __iced_deferrals._fulfill();
237
241
  })(function() {
@@ -265,7 +269,7 @@
265
269
  funcname: "TwitterScraper.users_lookup"
266
270
  });
267
271
  setTimeout(__iced_deferrals.defer({
268
- lineno: 137
272
+ lineno: 143
269
273
  }), cursor_wait);
270
274
  __iced_deferrals._fulfill();
271
275
  })(__iced_k);
@@ -360,7 +364,7 @@
360
364
  return json = arguments[2];
361
365
  };
362
366
  })(),
363
- lineno: 175
367
+ lineno: 181
364
368
  }));
365
369
  __iced_deferrals._fulfill();
366
370
  })(function() {
@@ -397,7 +401,7 @@
397
401
  funcname: "TwitterScraper.get_follower_ids"
398
402
  });
399
403
  setTimeout(__iced_deferrals.defer({
400
- lineno: 191
404
+ lineno: 197
401
405
  }), cursor_wait);
402
406
  __iced_deferrals._fulfill();
403
407
  })(__iced_k);
@@ -513,7 +517,7 @@
513
517
  return body_obj = arguments[2];
514
518
  };
515
519
  })(),
516
- lineno: 282
520
+ lineno: 288
517
521
  }));
518
522
  __iced_deferrals._fulfill();
519
523
  });
@@ -596,7 +600,7 @@
596
600
  return tok = arguments[1];
597
601
  };
598
602
  })(),
599
- lineno: 343
603
+ lineno: 349
600
604
  }));
601
605
  __iced_deferrals._fulfill();
602
606
  });
@@ -629,7 +633,7 @@
629
633
  return tok = arguments[2];
630
634
  };
631
635
  })(),
632
- lineno: 352
636
+ lineno: 358
633
637
  }));
634
638
  __iced_deferrals._fulfill();
635
639
  });
@@ -662,7 +666,7 @@
662
666
  return body = arguments[2];
663
667
  };
664
668
  })(),
665
- lineno: 363
669
+ lineno: 369
666
670
  }));
667
671
  __iced_deferrals._fulfill();
668
672
  })(__iced_k);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keybase-proofs",
3
- "version": "2.3.28",
3
+ "version": "2.3.29",
4
4
  "description": "Publicly-verifiable proofs of identity",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -75,7 +75,13 @@ exports.TwitterScraper = class TwitterScraper extends BaseScraper
75
75
  @log "| search index #{u} -> #{rc}"
76
76
  if rc isnt v_codes.OK then #noop
77
77
  else if not json? or (json.length is 0) then rc = v_codes.EMPTY_JSON
78
- else if not json.data? then rc = v_codes.INVALID_JSON
78
+ else if not json.data?
79
+ if json.meta?.result_count is 0
80
+ # No results.
81
+ rc = v_codes.NOT_FOUND
82
+ else
83
+ # Unknown JSON structure.
84
+ rc = v_codes.INVALID_JSON
79
85
  else
80
86
  rc = v_codes.NOT_FOUND
81
87
  for {text, id},i in json.data