@staff0rd/assist 0.310.3 → 0.310.5

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.310.3",
9
+ version: "0.310.5",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -5524,6 +5524,7 @@ async function listUsagePeaks(db) {
5524
5524
  return db.select().from(usagePeaks).orderBy(
5525
5525
  desc(usagePeaks.resetsAt),
5526
5526
  usagePeaks.window,
5527
+ desc(usagePeaks.createdAt),
5527
5528
  desc(usagePeaks.segment)
5528
5529
  );
5529
5530
  }
@@ -11880,16 +11881,26 @@ function hashtagsFrom(details) {
11880
11881
  }
11881
11882
  return [...new Set(tags)];
11882
11883
  }
11883
- function linksFrom(details) {
11884
- const links2 = details.map((detail) => asObject(detail.textLink)?.url).filter((url) => typeof url === "string");
11885
- return dedupeLinks(links2);
11884
+ function textLinksFrom(details) {
11885
+ return details.map((detail) => asObject(detail.textLink)?.url).filter((url) => typeof url === "string");
11886
+ }
11887
+ function articleCardLinksFrom(update3) {
11888
+ const article = asObject(asObject(update3.content)?.articleComponent);
11889
+ const url = asObject(article?.navigationContext)?.actionTarget;
11890
+ return typeof url === "string" ? [url] : [];
11891
+ }
11892
+ function linksFrom(update3, details) {
11893
+ return dedupeLinks([
11894
+ ...textLinksFrom(details),
11895
+ ...articleCardLinksFrom(update3)
11896
+ ]);
11886
11897
  }
11887
11898
  function collectVoyagerAttributes(update3, profiles, authorSlug) {
11888
11899
  const details = attributeDetails(update3);
11889
11900
  return {
11890
11901
  mentions: mentionsFrom(details, profiles, authorSlug),
11891
11902
  hashtags: hashtagsFrom(details),
11892
- links: linksFrom(details)
11903
+ links: linksFrom(update3, details)
11893
11904
  };
11894
11905
  }
11895
11906
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.310.3",
3
+ "version": "0.310.5",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {