@rmdes/indiekit-endpoint-syndicate 1.0.0-beta.46 → 1.0.0-beta.48

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/lib/utils.js +8 -18
  2. package/package.json +2 -2
package/lib/utils.js CHANGED
@@ -44,26 +44,16 @@ export const getPostData = async (postsCollection, url) => {
44
44
 
45
45
  /**
46
46
  * Get ALL posts awaiting syndication (batch mode)
47
+ *
48
+ * This was a second copy of `getPostsAwaitingSyndication`'s query that differed
49
+ * only in sorting `published: -1`, so a backlog went out newest first and
50
+ * arrived on the timeline in reverse. The duplicate is gone: both callers now
51
+ * share one query, oldest first, which is what the comment above already
52
+ * claimed and what upstream's batch path does.
47
53
  * @param {object} postsCollection - Posts database collection
48
- * @returns {Promise<Array>} Array of post data objects
54
+ * @returns {Promise<Array<object>>} Post data, oldest first
49
55
  */
50
- export const getAllPostData = async (postsCollection) => {
51
- const items = await postsCollection
52
- .find({
53
- "properties.mp-syndicate-to": {
54
- $exists: true,
55
- },
56
- // No syndication filter — let syndicateToTargets() handle dedup
57
- "properties.post-status": {
58
- $ne: "draft",
59
- },
60
- })
61
-
62
- .sort({ "properties.published": -1 })
63
- .toArray();
64
-
65
- return items;
66
- };
56
+ export const getAllPostData = getPostsAwaitingSyndication;
67
57
 
68
58
  /**
69
59
  * Check if target already returned a syndication URL
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-syndicate",
3
- "version": "1.0.0-beta.46",
3
+ "version": "1.0.0-beta.48",
4
4
  "description": "Syndication endpoint for Indiekit. Fork of @indiekit/endpoint-syndicate with batch syndication support and bug fixes.",
5
5
  "keywords": [
6
6
  "indiekit",
@@ -36,6 +36,6 @@
36
36
  "access": "public"
37
37
  },
38
38
  "scripts": {
39
- "test": "node --test test/*.js"
39
+ "test": "node --test \"tests/**/*.test.js\""
40
40
  }
41
41
  }