@nuelink/nuelink-cli 1.6.1 → 1.6.2
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 +8 -3
- package/package.json +51 -51
- package/src/output.js +10 -5
- package/test/cli.test.mjs +30 -0
- package/test/mock-fetch.cjs +3 -0
- package/test/mock-fetch.mjs +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.2
|
|
4
|
+
|
|
5
|
+
- Show effective channel names in table output for posts and other resources with channel summaries.
|
|
6
|
+
- Document the post channels response shape and target-versus-collection behavior.
|
|
7
|
+
|
|
3
8
|
## 1.6.1
|
|
4
9
|
|
|
5
10
|
- Reject HTTP redirects for API requests so mutation bodies and credentials are never forwarded to redirect destinations.
|
package/README.md
CHANGED
|
@@ -192,6 +192,8 @@ nuelink-cli automations --brand-id 13493 --per-page 5 --page 1
|
|
|
192
192
|
```
|
|
193
193
|
|
|
194
194
|
This table view is especially useful for quickly scanning automation status, feed type, and feed URL.
|
|
195
|
+
JSON responses also include `loadOldPosts`, `addPostsAsDraft`, and
|
|
196
|
+
`refreshRate` (hours; 1, 6, 12, or 24).
|
|
195
197
|
|
|
196
198
|
Create automation:
|
|
197
199
|
|
|
@@ -246,7 +248,10 @@ List posts:
|
|
|
246
248
|
nuelink-cli posts --brand-id 13493 --collection-id 33273 --per-page 5 --page 1
|
|
247
249
|
```
|
|
248
250
|
|
|
249
|
-
Post list output highlights the post ID, type, status,
|
|
251
|
+
Post list output highlights the post ID, type, status, publish date, and
|
|
252
|
+
effective channel names. In JSON mode, each post retains the API's full
|
|
253
|
+
channels array with id, name, status, and type; it lists post-targeted channels
|
|
254
|
+
when configured, otherwise the channels assigned to the collection.
|
|
250
255
|
Optional filters include `--status`, `--post-type`, `--posting-type`,
|
|
251
256
|
`--view` (`QUEUE`, `SCHEDULED`, `DRAFT`, or `PUBLISHED`), `--created-from`,
|
|
252
257
|
`--created-to`, `--sort-by`, and `--sort-order`.
|
|
@@ -267,7 +272,7 @@ nuelink-cli posts:add-json --brand-id 13493 --collection-id 33273 --payload ./po
|
|
|
267
272
|
```
|
|
268
273
|
|
|
269
274
|
You can also pipe JSON through stdin with `--payload -`.
|
|
270
|
-
CLI 1.6.0 preserves contract-nullable fields exactly; the dry-run body matches
|
|
275
|
+
CLI 1.6.0 and later preserves contract-nullable fields exactly; the dry-run body matches
|
|
271
276
|
the JSON body sent by the request.
|
|
272
277
|
|
|
273
278
|
Example `post.json`:
|
|
@@ -432,7 +437,7 @@ npm run check:pack:installed
|
|
|
432
437
|
|
|
433
438
|
## Release Checklist
|
|
434
439
|
|
|
435
|
-
1. Update version in
|
|
440
|
+
1. Update the version in package.json and package-lock.json, and add a matching entry at the top of CHANGELOG.md
|
|
436
441
|
2. Run `npm test`
|
|
437
442
|
3. Run `npm run check:pack`
|
|
438
443
|
4. Run `npm run check:pack:installed`
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@nuelink/nuelink-cli",
|
|
3
|
-
"version": "1.6.
|
|
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
|
-
"license": "MIT",
|
|
6
|
-
"author": "Nuelink",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/kreatinc/nuelink-cli.git"
|
|
10
|
-
},
|
|
11
|
-
"homepage": "https://github.com/kreatinc/nuelink-cli#readme",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/kreatinc/nuelink-cli/issues"
|
|
14
|
-
},
|
|
15
|
-
"type": "module",
|
|
16
|
-
"main": "./src/cli.js",
|
|
17
|
-
"scripts": {
|
|
18
|
-
"test": "node --test test/cli.test.mjs",
|
|
19
|
-
"smoke:auth": "node src/cli.js auth:status",
|
|
20
|
-
"check:pack": "node scripts/check-pack.mjs",
|
|
21
|
-
"check:pack:installed": "node scripts/check-packed-package.mjs"
|
|
22
|
-
},
|
|
23
|
-
"engines": {
|
|
24
|
-
"node": ">=18.17"
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"src",
|
|
28
|
-
"test",
|
|
29
|
-
"CHANGELOG.md",
|
|
30
|
-
"README.md",
|
|
31
|
-
"CONTRIBUTING.md",
|
|
32
|
-
"SECURITY.md",
|
|
33
|
-
"LICENSE"
|
|
34
|
-
],
|
|
35
|
-
"publishConfig": {
|
|
36
|
-
"access": "public"
|
|
37
|
-
},
|
|
38
|
-
"keywords": [
|
|
39
|
-
"nuelink",
|
|
40
|
-
"cli",
|
|
41
|
-
"social-media",
|
|
42
|
-
"automation"
|
|
43
|
-
],
|
|
44
|
-
"dependencies": {
|
|
45
|
-
"chalk": "^5.6.2",
|
|
46
|
-
"commander": "^13.1.0"
|
|
47
|
-
},
|
|
48
|
-
"bin": {
|
|
49
|
-
"nuelink-cli": "src/cli.js"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@nuelink/nuelink-cli",
|
|
3
|
+
"version": "1.6.2",
|
|
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
|
+
"license": "MIT",
|
|
6
|
+
"author": "Nuelink",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/kreatinc/nuelink-cli.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/kreatinc/nuelink-cli#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/kreatinc/nuelink-cli/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./src/cli.js",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "node --test test/cli.test.mjs",
|
|
19
|
+
"smoke:auth": "node src/cli.js auth:status",
|
|
20
|
+
"check:pack": "node scripts/check-pack.mjs",
|
|
21
|
+
"check:pack:installed": "node scripts/check-packed-package.mjs"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18.17"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"src",
|
|
28
|
+
"test",
|
|
29
|
+
"CHANGELOG.md",
|
|
30
|
+
"README.md",
|
|
31
|
+
"CONTRIBUTING.md",
|
|
32
|
+
"SECURITY.md",
|
|
33
|
+
"LICENSE"
|
|
34
|
+
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"nuelink",
|
|
40
|
+
"cli",
|
|
41
|
+
"social-media",
|
|
42
|
+
"automation"
|
|
43
|
+
],
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"chalk": "^5.6.2",
|
|
46
|
+
"commander": "^13.1.0"
|
|
47
|
+
},
|
|
48
|
+
"bin": {
|
|
49
|
+
"nuelink-cli": "src/cli.js"
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/output.js
CHANGED
|
@@ -19,7 +19,11 @@ function formatCell(value, maxLength = 42) {
|
|
|
19
19
|
} else if (typeof value === "number" || typeof value === "boolean") {
|
|
20
20
|
text = String(value);
|
|
21
21
|
} else if (Array.isArray(value)) {
|
|
22
|
-
|
|
22
|
+
if (value.every((item) => item && typeof item === "object" && !Array.isArray(item))) {
|
|
23
|
+
text = value.map((item) => item.name ?? item.id ?? JSON.stringify(item)).join(", ") || "none";
|
|
24
|
+
} else {
|
|
25
|
+
text = "[" + value.map((item) => formatCell(item, 18)).join(", ") + "]";
|
|
26
|
+
}
|
|
23
27
|
} else {
|
|
24
28
|
text = JSON.stringify(value);
|
|
25
29
|
}
|
|
@@ -45,6 +49,7 @@ function pickColumns(items) {
|
|
|
45
49
|
"queueStatus",
|
|
46
50
|
"timezone",
|
|
47
51
|
"collectionId",
|
|
52
|
+
"channels",
|
|
48
53
|
"postType",
|
|
49
54
|
"postingType",
|
|
50
55
|
"postDate",
|
|
@@ -53,7 +58,7 @@ function pickColumns(items) {
|
|
|
53
58
|
"createdAt",
|
|
54
59
|
"updatedAt",
|
|
55
60
|
];
|
|
56
|
-
const excludedKeys = new Set(["body", "caption", "media", "poll", "platforms", "queues"
|
|
61
|
+
const excludedKeys = new Set(["body", "caption", "media", "poll", "platforms", "queues"]);
|
|
57
62
|
const presentKeys = new Set(items.flatMap((item) => Object.keys(item)));
|
|
58
63
|
|
|
59
64
|
const columns = preferredKeys.filter((key) => presentKeys.has(key) && !excludedKeys.has(key));
|
|
@@ -64,17 +69,17 @@ function pickColumns(items) {
|
|
|
64
69
|
columns.push(key);
|
|
65
70
|
}
|
|
66
71
|
|
|
67
|
-
if (columns.length >=
|
|
72
|
+
if (columns.length >= 8) {
|
|
68
73
|
break;
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
|
|
72
|
-
if (columns.length >=
|
|
77
|
+
if (columns.length >= 8) {
|
|
73
78
|
break;
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
|
|
77
|
-
return columns.slice(0,
|
|
82
|
+
return columns.slice(0, 8);
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
function renderTable(items) {
|
package/test/cli.test.mjs
CHANGED
|
@@ -318,6 +318,36 @@ test("brands command renders table output", async () => {
|
|
|
318
318
|
assert.match(result.stdout, /zapier/);
|
|
319
319
|
});
|
|
320
320
|
|
|
321
|
+
test("post list table shows effective channel names", async () => {
|
|
322
|
+
const homeDir = await setupTempHome();
|
|
323
|
+
const capturePath = path.join(homeDir, "capture-post-channels.json");
|
|
324
|
+
const result = runCli({
|
|
325
|
+
args: ["posts", "--brand-id", "42", "--collection-id", "77"],
|
|
326
|
+
homeDir,
|
|
327
|
+
capturePath,
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
assert.equal(result.status, 0, result.stderr);
|
|
331
|
+
assert.match(result.stdout, /\|\s*Channels\s*\|/);
|
|
332
|
+
assert.match(result.stdout, /Product Instagram/);
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
test("post JSON output preserves effective channel summaries", async () => {
|
|
336
|
+
const homeDir = await setupTempHome();
|
|
337
|
+
const capturePath = path.join(homeDir, "capture-post-channels-json.json");
|
|
338
|
+
const result = runCli({
|
|
339
|
+
args: ["--json", "posts", "--brand-id", "42", "--collection-id", "77"],
|
|
340
|
+
homeDir,
|
|
341
|
+
capturePath,
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
assert.equal(result.status, 0, result.stderr);
|
|
345
|
+
const output = JSON.parse(result.stdout);
|
|
346
|
+
assert.deepEqual(output.data[0].channels, [
|
|
347
|
+
{ id: 501, name: "Product Instagram", status: "ACTIVE", type: "Instagram" },
|
|
348
|
+
]);
|
|
349
|
+
});
|
|
350
|
+
|
|
321
351
|
test("brands command can force json output", async () => {
|
|
322
352
|
const homeDir = await setupTempHome();
|
|
323
353
|
const capturePath = path.join(homeDir, "capture-brands-json.json");
|
package/test/mock-fetch.cjs
CHANGED
|
@@ -242,6 +242,9 @@ globalThis.fetch = async (input, init = {}) => {
|
|
|
242
242
|
postType: "IMAGE",
|
|
243
243
|
postingType: "SCHEDULE",
|
|
244
244
|
status: "PUBLISHED",
|
|
245
|
+
channels: [
|
|
246
|
+
{ id: 501, name: "Product Instagram", status: "ACTIVE", type: "Instagram" },
|
|
247
|
+
],
|
|
245
248
|
postDate: "2026-05-12 14:00:00",
|
|
246
249
|
createdAt: "2026-05-11T08:59:13.000000Z",
|
|
247
250
|
updatedAt: "2026-05-12T14:00:53.000000Z",
|
package/test/mock-fetch.mjs
CHANGED
|
@@ -242,6 +242,9 @@ globalThis.fetch = async (input, init = {}) => {
|
|
|
242
242
|
postType: "IMAGE",
|
|
243
243
|
postingType: "SCHEDULE",
|
|
244
244
|
status: "PUBLISHED",
|
|
245
|
+
channels: [
|
|
246
|
+
{ id: 501, name: "Product Instagram", status: "ACTIVE", type: "Instagram" },
|
|
247
|
+
],
|
|
245
248
|
postDate: "2026-05-12 14:00:00",
|
|
246
249
|
createdAt: "2026-05-11T08:59:13.000000Z",
|
|
247
250
|
updatedAt: "2026-05-12T14:00:53.000000Z",
|