@nuelink/nuelink-cli 1.3.6 → 1.3.7
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/package.json +1 -1
- package/src/cli.js +5 -4
- package/src/commands.js +74 -72
- package/src/config.js +4 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuelink/nuelink-cli",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
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/cli.js
CHANGED
|
@@ -11,10 +11,6 @@ const parsedAuth = extractApiKeyArg(process.argv.slice(2));
|
|
|
11
11
|
const runtimeApiKey = parsedAuth.apiKey;
|
|
12
12
|
const parseArgv = [process.argv[0], process.argv[1], ...parsedAuth.sanitizedArgs];
|
|
13
13
|
|
|
14
|
-
if (!process.env.NUELINK_API_KEY && runtimeApiKey) {
|
|
15
|
-
process.env.NUELINK_API_KEY = runtimeApiKey;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
14
|
registerCommands(program, runtimeApiKey, cliVersion);
|
|
19
15
|
|
|
20
16
|
const argvHasCommand = parsedAuth.sanitizedArgs.some((arg) => !arg.startsWith("-"));
|
|
@@ -22,6 +18,11 @@ const hasHelpFlag = parsedAuth.sanitizedArgs.includes("--help") || parsedAuth.sa
|
|
|
22
18
|
const hasVersionFlag = parsedAuth.sanitizedArgs.includes("--version") || parsedAuth.sanitizedArgs.includes("-V");
|
|
23
19
|
|
|
24
20
|
if (!argvHasCommand && !hasHelpFlag && !hasVersionFlag) {
|
|
21
|
+
if (runtimeApiKey) {
|
|
22
|
+
console.error("Missing command. Provide a command such as 'me' or 'auth:login'.");
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
25
26
|
program.outputHelp();
|
|
26
27
|
process.exit(0);
|
|
27
28
|
}
|
package/src/commands.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFile, stat } from "node:fs/promises";
|
|
1
|
+
import { readFile, stat } from "node:fs/promises";
|
|
2
2
|
import readline from "node:readline";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import chalk from "chalk";
|
|
@@ -7,15 +7,16 @@ import { clearApiKey, maskToken, readConfig, resolveApiKey, CONFIG_FILE, decrypt
|
|
|
7
7
|
import { brandPath, collectionPath, nuelinkRequest } from "./http.js";
|
|
8
8
|
import { buildPostPayload, parseCsv, VALID_PUBLISH_MODES } from "./postPayload.js";
|
|
9
9
|
import {
|
|
10
|
-
VALID_AUTOMATION_SUB_TYPES,
|
|
11
|
-
VALID_AUTOMATION_TYPES,
|
|
12
|
-
VALID_IMPORT_AS_TYPES,
|
|
13
|
-
VALID_MEDIA_FILTER_TYPES,
|
|
14
|
-
normalizeEnum,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
VALID_AUTOMATION_SUB_TYPES,
|
|
11
|
+
VALID_AUTOMATION_TYPES,
|
|
12
|
+
VALID_IMPORT_AS_TYPES,
|
|
13
|
+
VALID_MEDIA_FILTER_TYPES,
|
|
14
|
+
normalizeEnum,
|
|
15
|
+
parseBooleanStrict,
|
|
16
|
+
parseIntegerInRange,
|
|
17
|
+
parseJsonString,
|
|
18
|
+
parseOptionalNonNegativeInteger,
|
|
19
|
+
parsePositiveInteger,
|
|
19
20
|
splitCsv,
|
|
20
21
|
validateHttpUrl,
|
|
21
22
|
validateMediaFile,
|
|
@@ -137,9 +138,9 @@ async function promptHidden(promptText) {
|
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
async function resolveLoginApiKey(options) {
|
|
141
|
-
if (options.apiKey) {
|
|
142
|
-
return options.apiKey.trim();
|
|
141
|
+
async function resolveLoginApiKey(options, fallbackApiKey) {
|
|
142
|
+
if (options.apiKey || fallbackApiKey) {
|
|
143
|
+
return String(options.apiKey || fallbackApiKey).trim();
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
if (options.stdin || !process.stdin.isTTY) {
|
|
@@ -149,7 +150,7 @@ async function resolveLoginApiKey(options) {
|
|
|
149
150
|
return promptHidden("API key: ");
|
|
150
151
|
}
|
|
151
152
|
|
|
152
|
-
function buildRequestOptions(program) {
|
|
153
|
+
function buildRequestOptions(program) {
|
|
153
154
|
const options = program.opts();
|
|
154
155
|
|
|
155
156
|
return {
|
|
@@ -157,15 +158,15 @@ function buildRequestOptions(program) {
|
|
|
157
158
|
outputMode: options.json ? "json" : "table",
|
|
158
159
|
quiet: Boolean(options.quiet),
|
|
159
160
|
};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function validateMaxLength(value, maximum, label) {
|
|
163
|
-
if (value !== undefined && value !== null && String(value).length > maximum) {
|
|
164
|
-
throw new Error(`${label} must not exceed ${maximum} characters.`);
|
|
165
|
-
}
|
|
166
|
-
return value;
|
|
167
|
-
}
|
|
168
|
-
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function validateMaxLength(value, maximum, label) {
|
|
164
|
+
if (value !== undefined && value !== null && String(value).length > maximum) {
|
|
165
|
+
throw new Error(`${label} must not exceed ${maximum} characters.`);
|
|
166
|
+
}
|
|
167
|
+
return value;
|
|
168
|
+
}
|
|
169
|
+
|
|
169
170
|
async function executeRequest(program, runtimeApiKey, request) {
|
|
170
171
|
const requestOptions = buildRequestOptions(program);
|
|
171
172
|
const apiKey = requestOptions.dryRun ? undefined : await resolveApiKey(runtimeApiKey);
|
|
@@ -205,7 +206,7 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
205
206
|
.option("--api-key <apiKey>", "API key to save (prefer stdin or interactive prompt)")
|
|
206
207
|
.option("--stdin", "Read API key from stdin")
|
|
207
208
|
.action(withCommandErrorHandling(async (options) => {
|
|
208
|
-
const apiKey = await resolveLoginApiKey(options);
|
|
209
|
+
const apiKey = await resolveLoginApiKey(options, runtimeApiKey);
|
|
209
210
|
|
|
210
211
|
if (!apiKey) {
|
|
211
212
|
throw new Error("Missing API key. Provide --stdin, pipe a key to auth:login, or enter it interactively.");
|
|
@@ -228,13 +229,13 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
228
229
|
.command("auth:status")
|
|
229
230
|
.description("Show where auth is currently resolved from")
|
|
230
231
|
.action(withCommandErrorHandling(async () => {
|
|
231
|
-
if (
|
|
232
|
-
console.log(chalk.green(`Auth source:
|
|
232
|
+
if (runtimeApiKey) {
|
|
233
|
+
console.log(chalk.green(`Auth source: runtime CLI flag (${maskToken(runtimeApiKey)})`));
|
|
233
234
|
return;
|
|
234
235
|
}
|
|
235
236
|
|
|
236
|
-
if (
|
|
237
|
-
console.log(chalk.green(`Auth source:
|
|
237
|
+
if (process.env.NUELINK_API_KEY) {
|
|
238
|
+
console.log(chalk.green(`Auth source: NUELINK_API_KEY (${maskToken(process.env.NUELINK_API_KEY)})`));
|
|
238
239
|
return;
|
|
239
240
|
}
|
|
240
241
|
|
|
@@ -255,6 +256,7 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
console.log(chalk.yellow("No API key configured. Use auth:login to save one, or pass --api-key for a single command."));
|
|
259
|
+
process.exitCode = 1;
|
|
258
260
|
}));
|
|
259
261
|
|
|
260
262
|
program
|
|
@@ -273,7 +275,7 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
273
275
|
await executeRequest(program, runtimeApiKey, {
|
|
274
276
|
endpoint: "/brands",
|
|
275
277
|
query: {
|
|
276
|
-
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
278
|
+
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
277
279
|
page: parsePositiveInteger(options.page, "page"),
|
|
278
280
|
},
|
|
279
281
|
});
|
|
@@ -289,7 +291,7 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
289
291
|
await executeRequest(program, runtimeApiKey, {
|
|
290
292
|
endpoint: `${brandPath(parsePositiveInteger(options.brandId, "brand-id"))}/collections`,
|
|
291
293
|
query: {
|
|
292
|
-
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
294
|
+
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
293
295
|
page: parsePositiveInteger(options.page, "page"),
|
|
294
296
|
},
|
|
295
297
|
});
|
|
@@ -312,9 +314,9 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
312
314
|
method: "POST",
|
|
313
315
|
endpoint: `${brandPath(parsePositiveInteger(options.brandId, "brand-id"))}/collections`,
|
|
314
316
|
body: {
|
|
315
|
-
title: validateMaxLength(options.title, 255, "title"),
|
|
316
|
-
description: validateMaxLength(options.description, 1000, "description"),
|
|
317
|
-
maxRepublish: parseOptionalNonNegativeInteger(options.maxRepublish, "max-republish"),
|
|
317
|
+
title: validateMaxLength(options.title, 255, "title"),
|
|
318
|
+
description: validateMaxLength(options.description, 1000, "description"),
|
|
319
|
+
maxRepublish: parseOptionalNonNegativeInteger(options.maxRepublish, "max-republish"),
|
|
318
320
|
channels,
|
|
319
321
|
queues,
|
|
320
322
|
},
|
|
@@ -331,7 +333,7 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
331
333
|
await executeRequest(program, runtimeApiKey, {
|
|
332
334
|
endpoint: `${brandPath(parsePositiveInteger(options.brandId, "brand-id"))}/automations`,
|
|
333
335
|
query: {
|
|
334
|
-
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
336
|
+
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
335
337
|
page: parsePositiveInteger(options.page, "page"),
|
|
336
338
|
},
|
|
337
339
|
});
|
|
@@ -347,12 +349,12 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
347
349
|
.requiredOption("--sub-type <type>", "Sub type, e.g. RSS")
|
|
348
350
|
.requiredOption("--title <title>", "Automation title")
|
|
349
351
|
.option("--type <type>", "Automation type", "FEED")
|
|
350
|
-
.option("--dynamic-title <text>", "Dynamic title", "{{title}}")
|
|
351
|
-
.option("--dynamic-body <text>", "Dynamic body", "{title} {link}")
|
|
352
|
-
.option("--description <text>", "Automation description")
|
|
353
|
-
.option("--load-old-posts <boolean>", "Import existing feed items: true/false")
|
|
354
|
-
.option("--add-posts-as-draft <boolean>", "Create imported posts as drafts: true/false")
|
|
355
|
-
.option("--refresh-rate <hours>", "Refresh interval (24, 12, 6, or 1 hours)")
|
|
352
|
+
.option("--dynamic-title <text>", "Dynamic title", "{{title}}")
|
|
353
|
+
.option("--dynamic-body <text>", "Dynamic body", "{title} {link}")
|
|
354
|
+
.option("--description <text>", "Automation description")
|
|
355
|
+
.option("--load-old-posts <boolean>", "Import existing feed items: true/false")
|
|
356
|
+
.option("--add-posts-as-draft <boolean>", "Create imported posts as drafts: true/false")
|
|
357
|
+
.option("--refresh-rate <hours>", "Refresh interval (24, 12, 6, or 1 hours)")
|
|
356
358
|
.action(withCommandErrorHandling(async (options) => {
|
|
357
359
|
await executeRequest(program, runtimeApiKey, {
|
|
358
360
|
method: "POST",
|
|
@@ -362,17 +364,17 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
362
364
|
feedUrl: validateHttpUrl(options.feedUrl, "feed-url"),
|
|
363
365
|
importAsType: normalizeEnum(options.importAsType, "import-as-type", VALID_IMPORT_AS_TYPES),
|
|
364
366
|
subType: normalizeEnum(options.subType, "sub-type", VALID_AUTOMATION_SUB_TYPES),
|
|
365
|
-
title: validateMaxLength(options.title, 255, "title"),
|
|
367
|
+
title: validateMaxLength(options.title, 255, "title"),
|
|
366
368
|
type: normalizeEnum(options.type, "type", VALID_AUTOMATION_TYPES),
|
|
367
|
-
dynamicTitle: validateMaxLength(options.dynamicTitle, 255, "dynamic-title"),
|
|
368
|
-
dynamicBody: validateMaxLength(options.dynamicBody, 255, "dynamic-body"),
|
|
369
|
-
description: options.description,
|
|
370
|
-
loadOldPosts: parseBooleanStrict(options.loadOldPosts, "load-old-posts"),
|
|
371
|
-
addPostsAsDraft: parseBooleanStrict(options.addPostsAsDraft, "add-posts-as-draft"),
|
|
372
|
-
refreshRate: options.refreshRate === undefined
|
|
373
|
-
? undefined
|
|
374
|
-
: Number(normalizeEnum(options.refreshRate, "refresh-rate", ["24", "12", "6", "1"])),
|
|
375
|
-
},
|
|
369
|
+
dynamicTitle: validateMaxLength(options.dynamicTitle, 255, "dynamic-title"),
|
|
370
|
+
dynamicBody: validateMaxLength(options.dynamicBody, 255, "dynamic-body"),
|
|
371
|
+
description: options.description,
|
|
372
|
+
loadOldPosts: parseBooleanStrict(options.loadOldPosts, "load-old-posts"),
|
|
373
|
+
addPostsAsDraft: parseBooleanStrict(options.addPostsAsDraft, "add-posts-as-draft"),
|
|
374
|
+
refreshRate: options.refreshRate === undefined
|
|
375
|
+
? undefined
|
|
376
|
+
: Number(normalizeEnum(options.refreshRate, "refresh-rate", ["24", "12", "6", "1"])),
|
|
377
|
+
},
|
|
376
378
|
});
|
|
377
379
|
}));
|
|
378
380
|
|
|
@@ -386,7 +388,7 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
386
388
|
await executeRequest(program, runtimeApiKey, {
|
|
387
389
|
endpoint: `${brandPath(parsePositiveInteger(options.brandId, "brand-id"))}/channels`,
|
|
388
390
|
query: {
|
|
389
|
-
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
391
|
+
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
390
392
|
page: parsePositiveInteger(options.page, "page"),
|
|
391
393
|
},
|
|
392
394
|
});
|
|
@@ -395,19 +397,19 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
395
397
|
program
|
|
396
398
|
.command("media")
|
|
397
399
|
.description("List media for a brand")
|
|
398
|
-
.requiredOption("--brand-id <id>", "Brand ID")
|
|
399
|
-
.option("--type <type>", `Media type filter (${VALID_MEDIA_FILTER_TYPES.join(", ")})`)
|
|
400
|
-
.option("--per-page <number>", "Items per page", "25")
|
|
400
|
+
.requiredOption("--brand-id <id>", "Brand ID")
|
|
401
|
+
.option("--type <type>", `Media type filter (${VALID_MEDIA_FILTER_TYPES.join(", ")})`)
|
|
402
|
+
.option("--per-page <number>", "Items per page", "25")
|
|
401
403
|
.option("--page <number>", "Page number", "1")
|
|
402
404
|
.action(withCommandErrorHandling(async (options) => {
|
|
403
405
|
await executeRequest(program, runtimeApiKey, {
|
|
404
406
|
endpoint: `${brandPath(parsePositiveInteger(options.brandId, "brand-id"))}/media`,
|
|
405
407
|
query: {
|
|
406
|
-
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
407
|
-
page: parsePositiveInteger(options.page, "page"),
|
|
408
|
-
type: options.type
|
|
409
|
-
? normalizeEnum(options.type, "type", VALID_MEDIA_FILTER_TYPES)
|
|
410
|
-
: undefined,
|
|
408
|
+
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
409
|
+
page: parsePositiveInteger(options.page, "page"),
|
|
410
|
+
type: options.type
|
|
411
|
+
? normalizeEnum(options.type, "type", VALID_MEDIA_FILTER_TYPES)
|
|
412
|
+
: undefined,
|
|
411
413
|
},
|
|
412
414
|
});
|
|
413
415
|
}));
|
|
@@ -422,8 +424,8 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
422
424
|
const fileStat = await stat(options.file);
|
|
423
425
|
const { mediaType, size } = validateMediaFile(options.file, fileStat);
|
|
424
426
|
const formData = new FormData();
|
|
425
|
-
const fileBuffer = await readFile(options.file);
|
|
426
|
-
const fileBlob = new Blob([fileBuffer], { type: mediaType });
|
|
427
|
+
const fileBuffer = await readFile(options.file);
|
|
428
|
+
const fileBlob = new Blob([fileBuffer], { type: mediaType });
|
|
427
429
|
formData.append("media", fileBlob, path.basename(options.file));
|
|
428
430
|
|
|
429
431
|
await executeRequest(program, runtimeApiKey, {
|
|
@@ -452,7 +454,7 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
452
454
|
parsePositiveInteger(options.collectionId, "collection-id"),
|
|
453
455
|
)}/posts`,
|
|
454
456
|
query: {
|
|
455
|
-
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
457
|
+
per_page: parseIntegerInRange(options.perPage, "per-page", 1, 100),
|
|
456
458
|
page: parsePositiveInteger(options.page, "page"),
|
|
457
459
|
},
|
|
458
460
|
});
|
|
@@ -490,8 +492,8 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
490
492
|
.option("--alt <text>", "Alt text")
|
|
491
493
|
.option("--link <url>", "Post link")
|
|
492
494
|
.option("--publish-mode <mode>", `Publish mode (${VALID_PUBLISH_MODES.join(", ")})`, "DRAFT")
|
|
493
|
-
.option("--scheduled-at <value>", "Publish datetime (YYYY-MM-DD HH:mm:ss) or null")
|
|
494
|
-
.option("--post-as-story <boolean>", "Post as story: true/false")
|
|
495
|
+
.option("--scheduled-at <value>", "Publish datetime (YYYY-MM-DD HH:mm:ss) or null")
|
|
496
|
+
.option("--post-as-story <boolean>", "Post as story: true/false")
|
|
495
497
|
.option("--comment <text>", "First comment")
|
|
496
498
|
.option("--comment-delay <seconds>", "First comment delay seconds")
|
|
497
499
|
.option("--media-ids <ids>", "Comma-separated media IDs")
|
|
@@ -499,20 +501,20 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
|
|
|
499
501
|
.option("--poll-question <text>", "Poll question")
|
|
500
502
|
.option("--poll-options <items>", "Comma-separated poll options")
|
|
501
503
|
.option("--poll-period <value>", "Poll period (e.g. 3d)")
|
|
502
|
-
.option("--poll-correct-option-index <number>", "Zero-based poll correct option index")
|
|
504
|
+
.option("--poll-correct-option-index <number>", "Zero-based poll correct option index")
|
|
503
505
|
.option("--poll-explanation <text>", "Poll explanation")
|
|
504
506
|
.option("--instagram-collab <username>", "Instagram collab username")
|
|
505
507
|
.option("--instagram-location-id <id>", "Instagram location ID")
|
|
506
508
|
.option("--instagram-location-name <name>", "Instagram location name")
|
|
507
509
|
.option("--instagram-trial-reel <mode>", "Instagram trial reel mode")
|
|
508
510
|
.option("--instagram-share-to-feed <boolean>", "Instagram share to feed true/false")
|
|
509
|
-
.option("--facebook-location-id <id>", "Facebook location ID")
|
|
510
|
-
.option("--facebook-location-name <name>", "Facebook location name")
|
|
511
|
-
.option("--tiktok-send-to-inbox <boolean>", "TikTok send to inbox true/false")
|
|
512
|
-
.option("--tiktok-auto-add-music <boolean>", "TikTok auto-add music: true/false")
|
|
513
|
-
.option("--youtube-tags <tags>", "Comma-separated YouTube tags")
|
|
514
|
-
.option("--youtube-playlists <json>", "YouTube playlists JSON string")
|
|
515
|
-
.option("--googlemybusiness-upload-to-photos-section <boolean>", "Upload to Google Business Profile photos: true/false")
|
|
511
|
+
.option("--facebook-location-id <id>", "Facebook location ID")
|
|
512
|
+
.option("--facebook-location-name <name>", "Facebook location name")
|
|
513
|
+
.option("--tiktok-send-to-inbox <boolean>", "TikTok send to inbox true/false")
|
|
514
|
+
.option("--tiktok-auto-add-music <boolean>", "TikTok auto-add music: true/false")
|
|
515
|
+
.option("--youtube-tags <tags>", "Comma-separated YouTube tags")
|
|
516
|
+
.option("--youtube-playlists <json>", "YouTube playlists JSON string")
|
|
517
|
+
.option("--googlemybusiness-upload-to-photos-section <boolean>", "Upload to Google Business Profile photos: true/false")
|
|
516
518
|
.action(withCommandErrorHandling(async (options) => {
|
|
517
519
|
const payload = buildPostPayload(options);
|
|
518
520
|
|
package/src/config.js
CHANGED
|
@@ -79,15 +79,14 @@ async function clearApiKey() {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
async function resolveApiKey(runtimeApiKey) {
|
|
82
|
-
if (process.env.NUELINK_API_KEY) {
|
|
83
|
-
return process.env.NUELINK_API_KEY;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
82
|
if (runtimeApiKey) {
|
|
87
|
-
process.env.NUELINK_API_KEY = runtimeApiKey;
|
|
88
83
|
return runtimeApiKey;
|
|
89
84
|
}
|
|
90
85
|
|
|
86
|
+
if (process.env.NUELINK_API_KEY) {
|
|
87
|
+
return process.env.NUELINK_API_KEY;
|
|
88
|
+
}
|
|
89
|
+
|
|
91
90
|
const config = await readConfig();
|
|
92
91
|
const storedApiKey = decryptApiKey(config);
|
|
93
92
|
|