@nuelink/nuelink-cli 1.6.2 → 1.6.3
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 +5 -0
- package/README.md +4 -3
- package/package.json +1 -1
- package/src/output.js +2 -0
- package/test/cli.test.mjs +34 -0
- package/test/mock-fetch.cjs +2 -0
- package/test/mock-fetch.mjs +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.3
|
|
4
|
+
|
|
5
|
+
- Show automation draft behavior and refresh interval in table output.
|
|
6
|
+
- Document CLI options for setting automation draft behavior and refresh interval.
|
|
7
|
+
|
|
3
8
|
## 1.6.2
|
|
4
9
|
|
|
5
10
|
- Show effective channel names in table output for posts and other resources with channel summaries.
|
package/README.md
CHANGED
|
@@ -191,9 +191,8 @@ with `--description`.
|
|
|
191
191
|
nuelink-cli automations --brand-id 13493 --per-page 5 --page 1
|
|
192
192
|
```
|
|
193
193
|
|
|
194
|
-
|
|
195
|
-
JSON
|
|
196
|
-
`refreshRate` (hours; 1, 6, 12, or 24).
|
|
194
|
+
The table and JSON output include `addPostsAsDraft` and `refreshRate`
|
|
195
|
+
(hours; 1, 6, 12, or 24). JSON also includes other fields returned by the API.
|
|
197
196
|
|
|
198
197
|
Create automation:
|
|
199
198
|
|
|
@@ -207,6 +206,8 @@ nuelink-cli automations:create \
|
|
|
207
206
|
--type RSS \
|
|
208
207
|
--title "{{title}}" \
|
|
209
208
|
--caption "{{description}} {{link}}" \
|
|
209
|
+
--add-posts-as-draft true \
|
|
210
|
+
--refresh-rate 6 \
|
|
210
211
|
--dry-run
|
|
211
212
|
```
|
|
212
213
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuelink/nuelink-cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
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/output.js
CHANGED
package/test/cli.test.mjs
CHANGED
|
@@ -177,6 +177,20 @@ test("automations command builds pagination query", async () => {
|
|
|
177
177
|
assert.equal(url.searchParams.get("page"), "2");
|
|
178
178
|
});
|
|
179
179
|
|
|
180
|
+
test("automation table shows draft setting and refresh interval", async () => {
|
|
181
|
+
const homeDir = await setupTempHome();
|
|
182
|
+
const result = runCli({
|
|
183
|
+
args: ["automations", "--brand-id", "13493"],
|
|
184
|
+
homeDir,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
assert.equal(result.status, 0, result.stderr);
|
|
188
|
+
assert.match(result.stdout, /\|\s*Add Posts As Draft\s*\|/);
|
|
189
|
+
assert.match(result.stdout, /\|\s*Refresh Rate\s*\|/);
|
|
190
|
+
assert.match(result.stdout, /\|\s*true\s*\|/);
|
|
191
|
+
assert.match(result.stdout, /\|\s*6\s*\|/);
|
|
192
|
+
});
|
|
193
|
+
|
|
180
194
|
test("media command builds pagination query", async () => {
|
|
181
195
|
const homeDir = await setupTempHome();
|
|
182
196
|
const capturePath = path.join(homeDir, "capture-media.json");
|
|
@@ -500,6 +514,26 @@ test("automations:create works when boolean flags are omitted", async () => {
|
|
|
500
514
|
assert.equal(capture.body.addPostsAsDraft, undefined);
|
|
501
515
|
});
|
|
502
516
|
|
|
517
|
+
test("automations:create sends draft setting and refresh interval", async () => {
|
|
518
|
+
const homeDir = await setupTempHome();
|
|
519
|
+
const capturePath = path.join(homeDir, "capture-automation-options.json");
|
|
520
|
+
const result = runCli({
|
|
521
|
+
args: [
|
|
522
|
+
"automations:create", "--brand-id", "10", "--collection-id", "20",
|
|
523
|
+
"--feed-url", "https://example.com/feed.xml", "--import-as-type", "IMAGE",
|
|
524
|
+
"--type", "RSS", "--name", "Automation", "--add-posts-as-draft", "true",
|
|
525
|
+
"--refresh-rate", "6",
|
|
526
|
+
],
|
|
527
|
+
homeDir,
|
|
528
|
+
capturePath,
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
assert.equal(result.status, 0, result.stderr);
|
|
532
|
+
const capture = JSON.parse(await readFile(capturePath, "utf8"));
|
|
533
|
+
assert.equal(capture.body.addPostsAsDraft, true);
|
|
534
|
+
assert.equal(capture.body.refreshRate, 6);
|
|
535
|
+
});
|
|
536
|
+
|
|
503
537
|
test("auth:login stores token in isolated home config", async () => {
|
|
504
538
|
const homeDir = await setupTempHome();
|
|
505
539
|
const result = runCli({
|
package/test/mock-fetch.cjs
CHANGED
|
@@ -173,6 +173,8 @@ globalThis.fetch = async (input, init = {}) => {
|
|
|
173
173
|
feedUrl: "https://www.nasa.gov/rss/dyn/breaking_news.rss",
|
|
174
174
|
runCount: 0,
|
|
175
175
|
importAsType: "IMAGE",
|
|
176
|
+
addPostsAsDraft: true,
|
|
177
|
+
refreshRate: 6,
|
|
176
178
|
lastRun: 0,
|
|
177
179
|
title: "{{title}}",
|
|
178
180
|
caption: "{{description}} {{link}}",
|
package/test/mock-fetch.mjs
CHANGED
|
@@ -173,6 +173,8 @@ globalThis.fetch = async (input, init = {}) => {
|
|
|
173
173
|
feedUrl: "https://www.nasa.gov/rss/dyn/breaking_news.rss",
|
|
174
174
|
runCount: 0,
|
|
175
175
|
importAsType: "IMAGE",
|
|
176
|
+
addPostsAsDraft: true,
|
|
177
|
+
refreshRate: 6,
|
|
176
178
|
lastRun: 0,
|
|
177
179
|
title: "{{title}}",
|
|
178
180
|
caption: "{{description}} {{link}}",
|