@nuelink/nuelink-cli 1.6.4 → 1.6.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.6.5
4
+
5
+ - Use minutes, with a minimum of 1, for delayed-comment values in post creation.
6
+
3
7
  ## 1.6.4
4
8
 
5
9
  - Default `posts:create --auto-thread-text` to true, with false available to disable automatic splitting.
package/README.md CHANGED
@@ -327,6 +327,10 @@ nuelink-cli posts:create \
327
327
  --dry-run
328
328
  ```
329
329
 
330
+ `--comment-delay` is measured in minutes after publishing and must be a positive
331
+ integer (minimum `1`). Provide it together with `--comment`; the JSON/API field
332
+ is `comment.delay` and uses the same minutes unit.
333
+
330
334
  Review each mutation preview, then repeat the same command without `--dry-run`
331
335
  only when you intend to send it. `--dry-run` is supported for mutations; GET
332
336
  commands reject it instead of silently suppressing the read. Post creation and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuelink/nuelink-cli",
3
- "version": "1.6.4",
3
+ "version": "1.6.5",
4
4
  "description": "The official Nuelink CLI for automating social media workflows from your terminal. Schedule posts, upload media, manage brands, and integrate Nuelink into scripts, CI/CD pipelines, and AI agents.",
5
5
  "license": "MIT",
6
6
  "author": "Nuelink",
package/src/commands.js CHANGED
@@ -886,7 +886,7 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
886
886
  .option("--scheduled-at <value>", "Publish datetime (YYYY-MM-DD HH:mm:ss) or null")
887
887
  .option("--post-as-story <boolean>", "Post as story: true/false")
888
888
  .option("--comment <text>", "First comment")
889
- .option("--comment-delay <seconds>", "First comment delay seconds")
889
+ .option("--comment-delay <minutes>", "First comment delay in minutes (minimum 1)")
890
890
  .option("--media-ids <ids>", "Comma-separated media IDs")
891
891
  .option("--media-urls <urls>", "Comma-separated media URLs")
892
892
  .option("--poll-question <text>", "Poll question")
@@ -2,6 +2,7 @@ import {
2
2
  parseBooleanStrict,
3
3
  parseJsonString,
4
4
  parseOptionalNonNegativeInteger,
5
+ parseOptionalPositiveInteger,
5
6
  splitCsv,
6
7
  validateHttpUrl,
7
8
  validatePollOptions,
@@ -297,8 +298,8 @@ function buildPostPayload(options) {
297
298
  ? {
298
299
  comment: {
299
300
  comment: options.comment,
300
- ...(parseOptionalNonNegativeInteger(options.commentDelay, "comment-delay") !== undefined
301
- ? { delay: parseOptionalNonNegativeInteger(options.commentDelay, "comment-delay") }
301
+ ...(parseOptionalPositiveInteger(options.commentDelay, "comment-delay") !== undefined
302
+ ? { delay: parseOptionalPositiveInteger(options.commentDelay, "comment-delay") }
302
303
  : {}),
303
304
  },
304
305
  }
package/test/cli.test.mjs CHANGED
@@ -1529,6 +1529,28 @@ test("posts:create requires comment and comment-delay as a pair", async () => {
1529
1529
  }
1530
1530
  });
1531
1531
 
1532
+ test("posts:create requires a positive comment delay in minutes", async () => {
1533
+ const homeDir = await setupTempHome();
1534
+ const capturePath = path.join(homeDir, "capture-comment-zero.json");
1535
+ const result = runCli({
1536
+ args: [
1537
+ "posts:create",
1538
+ "--brand-id", "1",
1539
+ "--collection-id", "2",
1540
+ "--caption", "Post body",
1541
+ "--comment", "First comment",
1542
+ "--comment-delay", "0",
1543
+ "--dry-run",
1544
+ ],
1545
+ homeDir,
1546
+ capturePath,
1547
+ });
1548
+
1549
+ assert.equal(result.status, 1);
1550
+ assert.match(result.stderr, /Invalid comment-delay\. Expected a positive integer/);
1551
+ await assert.rejects(readFile(capturePath, "utf8"));
1552
+ });
1553
+
1532
1554
  test("JSON mode without a command returns a structured usage error", async () => {
1533
1555
  const homeDir = await setupTempHome();
1534
1556
  const result = runCli({