@walkeros/cli 3.0.1 → 3.0.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 +8 -0
- package/dist/cli.js +75 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +78 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -18169,7 +18169,7 @@ function rn2(n3, e4) {
|
|
|
18169
18169
|
}, () => J3({ ok: false }))(), "Push", n3.hooks);
|
|
18170
18170
|
}
|
|
18171
18171
|
async function un2(n3) {
|
|
18172
|
-
const e4 = W({ globalsStatic: {}, sessionStatic: {}, tagging: 0, run: true }, n3, { merge: false, extend: false }), t2 = { level: n3.logger?.level, handler: n3.logger?.handler }, o2 = de(t2), s3 = { ...e4.globalsStatic, ...n3.globals }, a3 = { allowed: false, config: e4, consent: n3.consent || {}, count: 0, custom: n3.custom || {}, destinations: {}, transformers: {}, stores: {}, globals: s3, group: "", hooks: {}, logger: o2, on: {}, queue: [], round: 0, session: void 0, status: { startedAt: Date.now(), in: 0, out: 0, failed: 0, sources: {}, destinations: {} }, timing: Date.now(), user: n3.user || {}, version: "3.0.
|
|
18172
|
+
const e4 = W({ globalsStatic: {}, sessionStatic: {}, tagging: 0, run: true }, n3, { merge: false, extend: false }), t2 = { level: n3.logger?.level, handler: n3.logger?.handler }, o2 = de(t2), s3 = { ...e4.globalsStatic, ...n3.globals }, a3 = { allowed: false, config: e4, consent: n3.consent || {}, count: 0, custom: n3.custom || {}, destinations: {}, transformers: {}, stores: {}, globals: s3, group: "", hooks: {}, logger: o2, on: {}, queue: [], round: 0, session: void 0, status: { startedAt: Date.now(), in: 0, out: 0, failed: 0, sources: {}, destinations: {} }, timing: Date.now(), user: n3.user || {}, version: "3.0.1", sources: {}, pending: { sources: {}, destinations: {} }, push: void 0, command: void 0 };
|
|
18173
18173
|
a3.push = rn2(a3, (n4) => ({ timing: Math.round((Date.now() - a3.timing) / 10) / 100, source: { type: "collector", id: "", previous_id: "" }, ...n4 })), a3.command = (function(n4, e5) {
|
|
18174
18174
|
return Te(async (t3, o3, s4) => await he(async () => await e5(n4, t3, o3, s4), () => J3({ ok: false }))(), "Command", n4.hooks);
|
|
18175
18175
|
})(a3, Y3);
|
|
@@ -21619,6 +21619,77 @@ async function createDeployCommand(config2, options) {
|
|
|
21619
21619
|
}
|
|
21620
21620
|
}
|
|
21621
21621
|
|
|
21622
|
+
// src/commands/feedback/index.ts
|
|
21623
|
+
init_config_file();
|
|
21624
|
+
init_cli_logger();
|
|
21625
|
+
import { createInterface } from "readline";
|
|
21626
|
+
async function feedback(text, options) {
|
|
21627
|
+
const config2 = readConfig();
|
|
21628
|
+
const anonymous = options?.anonymous ?? config2?.anonymousFeedback ?? true;
|
|
21629
|
+
const payload = { text };
|
|
21630
|
+
if (!anonymous && config2?.email) {
|
|
21631
|
+
payload.userId = config2.email;
|
|
21632
|
+
const projectId = process.env.WALKEROS_PROJECT_ID;
|
|
21633
|
+
if (projectId) {
|
|
21634
|
+
payload.projectId = projectId;
|
|
21635
|
+
}
|
|
21636
|
+
}
|
|
21637
|
+
const appUrl = resolveAppUrl();
|
|
21638
|
+
const response = await fetch(`${appUrl}/api/feedback`, {
|
|
21639
|
+
method: "POST",
|
|
21640
|
+
headers: { "Content-Type": "application/json" },
|
|
21641
|
+
body: JSON.stringify(payload)
|
|
21642
|
+
});
|
|
21643
|
+
if (!response.ok) {
|
|
21644
|
+
throw new Error(
|
|
21645
|
+
`Feedback submission failed: ${response.status} ${response.statusText}`
|
|
21646
|
+
);
|
|
21647
|
+
}
|
|
21648
|
+
}
|
|
21649
|
+
async function feedbackCommand(text) {
|
|
21650
|
+
const logger = createCLILogger({});
|
|
21651
|
+
try {
|
|
21652
|
+
const config2 = readConfig();
|
|
21653
|
+
let anonymous;
|
|
21654
|
+
if (config2?.anonymousFeedback === void 0) {
|
|
21655
|
+
const answer = await promptUser(
|
|
21656
|
+
"Include your user and project info with feedback? (y/N) "
|
|
21657
|
+
);
|
|
21658
|
+
const anonymousFeedback = !answer.toLowerCase().startsWith("y");
|
|
21659
|
+
if (config2) {
|
|
21660
|
+
writeConfig({ ...config2, anonymousFeedback });
|
|
21661
|
+
} else {
|
|
21662
|
+
writeConfig({
|
|
21663
|
+
token: "",
|
|
21664
|
+
email: "",
|
|
21665
|
+
appUrl: "",
|
|
21666
|
+
anonymousFeedback
|
|
21667
|
+
});
|
|
21668
|
+
}
|
|
21669
|
+
anonymous = anonymousFeedback;
|
|
21670
|
+
} else {
|
|
21671
|
+
anonymous = config2.anonymousFeedback;
|
|
21672
|
+
}
|
|
21673
|
+
await feedback(text, { anonymous });
|
|
21674
|
+
logger.info("Feedback sent. Thanks!");
|
|
21675
|
+
} catch (error48) {
|
|
21676
|
+
logger.error(error48 instanceof Error ? error48.message : String(error48));
|
|
21677
|
+
process.exit(1);
|
|
21678
|
+
}
|
|
21679
|
+
}
|
|
21680
|
+
function promptUser(question) {
|
|
21681
|
+
return new Promise((resolve2) => {
|
|
21682
|
+
const rl = createInterface({
|
|
21683
|
+
input: process.stdin,
|
|
21684
|
+
output: process.stderr
|
|
21685
|
+
});
|
|
21686
|
+
rl.question(question, (answer) => {
|
|
21687
|
+
rl.close();
|
|
21688
|
+
resolve2(answer);
|
|
21689
|
+
});
|
|
21690
|
+
});
|
|
21691
|
+
}
|
|
21692
|
+
|
|
21622
21693
|
// src/cli.ts
|
|
21623
21694
|
var program = new Command();
|
|
21624
21695
|
program.name("walkeros").description("walkerOS CLI - Bundle and deploy walkerOS components").version(VERSION);
|
|
@@ -21783,6 +21854,9 @@ program.command("run [file]").description("Run a walkerOS flow").option("-f, --f
|
|
|
21783
21854
|
silent: options.silent
|
|
21784
21855
|
});
|
|
21785
21856
|
});
|
|
21857
|
+
program.command("feedback <text>").description("Send feedback to walkerOS").action(async (text) => {
|
|
21858
|
+
await feedbackCommand(text);
|
|
21859
|
+
});
|
|
21786
21860
|
registerCacheCommand(program);
|
|
21787
21861
|
if (process.argv.length <= 2) {
|
|
21788
21862
|
printBanner(VERSION);
|
package/dist/index.d.ts
CHANGED
|
@@ -949,6 +949,12 @@ declare function createDeployCommand(config: string | undefined, options: Deploy
|
|
|
949
949
|
flow?: string;
|
|
950
950
|
}): Promise<void>;
|
|
951
951
|
|
|
952
|
+
interface FeedbackOptions {
|
|
953
|
+
anonymous?: boolean;
|
|
954
|
+
}
|
|
955
|
+
declare function feedback(text: string, options?: FeedbackOptions): Promise<void>;
|
|
956
|
+
declare function feedbackCommand(text: string): Promise<void>;
|
|
957
|
+
|
|
952
958
|
/**
|
|
953
959
|
* This file was auto-generated by openapi-typescript.
|
|
954
960
|
* Do not make direct changes to the file.
|
|
@@ -5091,6 +5097,21 @@ interface components {
|
|
|
5091
5097
|
|
|
5092
5098
|
declare function createApiClient(): openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
5093
5099
|
|
|
5100
|
+
interface WalkerOSConfig {
|
|
5101
|
+
token: string;
|
|
5102
|
+
email: string;
|
|
5103
|
+
appUrl: string;
|
|
5104
|
+
anonymousFeedback?: boolean;
|
|
5105
|
+
}
|
|
5106
|
+
/**
|
|
5107
|
+
* Read the stored config, or null if not found
|
|
5108
|
+
*/
|
|
5109
|
+
declare function readConfig(): WalkerOSConfig | null;
|
|
5110
|
+
/**
|
|
5111
|
+
* Write config to disk with 0600 permissions
|
|
5112
|
+
*/
|
|
5113
|
+
declare function writeConfig(config: WalkerOSConfig): void;
|
|
5114
|
+
|
|
5094
5115
|
/**
|
|
5095
5116
|
* Load and parse JSON configuration file from local path or URL.
|
|
5096
5117
|
*
|
|
@@ -5109,4 +5130,4 @@ declare function createApiClient(): openapi_fetch.Client<paths, `${string}/${str
|
|
|
5109
5130
|
*/
|
|
5110
5131
|
declare function loadJsonConfig<T>(configPath: string): Promise<T>;
|
|
5111
5132
|
|
|
5112
|
-
export { type BuildOptions, type BundleStats, type CLIBuildOptions, type DeployOptions, type ExampleLookupResult, type ExampleMatch, type GlobalOptions, type ListDeploymentsOptions, type ListFlowsOptions, type MinifyOptions, type PushResult, type RunCommandOptions, type RunOptions, type RunResult, type SSEEvent, type SSEParseResult, type SimulationResult, type ValidateResult, type ValidationError, type ValidationType, type ValidationWarning, bundle, bundleCommand, bundleRemote, compareOutput, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createProject, createProjectCommand, deleteDeployment, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deleteProject, deleteProjectCommand, deploy, deployAuthenticatedFetch, deployCommand, duplicateFlow, duplicateFlowCommand, findExample, getAuthHeaders, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFlow, getFlowCommand, getProject, getProjectCommand, getToken, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listProjects, listProjectsCommand, loadJsonConfig, loginCommand, logoutCommand, parseSSEEvents, push, pushCommand, requireProjectId, resolveBaseUrl, run, runCommand, simulate, simulateCommand, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, validate, validateCommand, whoami, whoamiCommand };
|
|
5133
|
+
export { type BuildOptions, type BundleStats, type CLIBuildOptions, type DeployOptions, type ExampleLookupResult, type ExampleMatch, type FeedbackOptions, type GlobalOptions, type ListDeploymentsOptions, type ListFlowsOptions, type MinifyOptions, type PushResult, type RunCommandOptions, type RunOptions, type RunResult, type SSEEvent, type SSEParseResult, type SimulationResult, type ValidateResult, type ValidationError, type ValidationType, type ValidationWarning, type WalkerOSConfig, bundle, bundleCommand, bundleRemote, compareOutput, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createProject, createProjectCommand, deleteDeployment, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deleteProject, deleteProjectCommand, deploy, deployAuthenticatedFetch, deployCommand, duplicateFlow, duplicateFlowCommand, feedback, feedbackCommand, findExample, getAuthHeaders, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFlow, getFlowCommand, getProject, getProjectCommand, getToken, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listProjects, listProjectsCommand, loadJsonConfig, loginCommand, logoutCommand, parseSSEEvents, push, pushCommand, readConfig, requireProjectId, resolveBaseUrl, run, runCommand, simulate, simulateCommand, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, validate, validateCommand, whoami, whoamiCommand, writeConfig };
|
package/dist/index.js
CHANGED
|
@@ -2937,7 +2937,7 @@ function rn(n, e2) {
|
|
|
2937
2937
|
}, () => J({ ok: false }))(), "Push", n.hooks);
|
|
2938
2938
|
}
|
|
2939
2939
|
async function un(n) {
|
|
2940
|
-
const e2 = r({ globalsStatic: {}, sessionStatic: {}, tagging: 0, run: true }, n, { merge: false, extend: false }), t2 = { level: n.logger?.level, handler: n.logger?.handler }, o2 = i(t2), s2 = { ...e2.globalsStatic, ...n.globals }, a2 = { allowed: false, config: e2, consent: n.consent || {}, count: 0, custom: n.custom || {}, destinations: {}, transformers: {}, stores: {}, globals: s2, group: "", hooks: {}, logger: o2, on: {}, queue: [], round: 0, session: void 0, status: { startedAt: Date.now(), in: 0, out: 0, failed: 0, sources: {}, destinations: {} }, timing: Date.now(), user: n.user || {}, version: "3.0.
|
|
2940
|
+
const e2 = r({ globalsStatic: {}, sessionStatic: {}, tagging: 0, run: true }, n, { merge: false, extend: false }), t2 = { level: n.logger?.level, handler: n.logger?.handler }, o2 = i(t2), s2 = { ...e2.globalsStatic, ...n.globals }, a2 = { allowed: false, config: e2, consent: n.consent || {}, count: 0, custom: n.custom || {}, destinations: {}, transformers: {}, stores: {}, globals: s2, group: "", hooks: {}, logger: o2, on: {}, queue: [], round: 0, session: void 0, status: { startedAt: Date.now(), in: 0, out: 0, failed: 0, sources: {}, destinations: {} }, timing: Date.now(), user: n.user || {}, version: "3.0.1", sources: {}, pending: { sources: {}, destinations: {} }, push: void 0, command: void 0 };
|
|
2941
2941
|
a2.push = rn(a2, (n2) => ({ timing: Math.round((Date.now() - a2.timing) / 10) / 100, source: { type: "collector", id: "", previous_id: "" }, ...n2 })), a2.command = (function(n2, e3) {
|
|
2942
2942
|
return an(async (t3, o3, s3) => await cn(async () => await e3(n2, t3, o3, s3), () => J({ ok: false }))(), "Command", n2.hooks);
|
|
2943
2943
|
})(a2, Y);
|
|
@@ -6464,10 +6464,82 @@ async function createDeployCommand(config, options) {
|
|
|
6464
6464
|
}
|
|
6465
6465
|
}
|
|
6466
6466
|
|
|
6467
|
+
// src/commands/feedback/index.ts
|
|
6468
|
+
init_config_file();
|
|
6469
|
+
init_cli_logger();
|
|
6470
|
+
import { createInterface } from "readline";
|
|
6471
|
+
async function feedback(text, options) {
|
|
6472
|
+
const config = readConfig();
|
|
6473
|
+
const anonymous = options?.anonymous ?? config?.anonymousFeedback ?? true;
|
|
6474
|
+
const payload = { text };
|
|
6475
|
+
if (!anonymous && config?.email) {
|
|
6476
|
+
payload.userId = config.email;
|
|
6477
|
+
const projectId = process.env.WALKEROS_PROJECT_ID;
|
|
6478
|
+
if (projectId) {
|
|
6479
|
+
payload.projectId = projectId;
|
|
6480
|
+
}
|
|
6481
|
+
}
|
|
6482
|
+
const appUrl = resolveAppUrl();
|
|
6483
|
+
const response = await fetch(`${appUrl}/api/feedback`, {
|
|
6484
|
+
method: "POST",
|
|
6485
|
+
headers: { "Content-Type": "application/json" },
|
|
6486
|
+
body: JSON.stringify(payload)
|
|
6487
|
+
});
|
|
6488
|
+
if (!response.ok) {
|
|
6489
|
+
throw new Error(
|
|
6490
|
+
`Feedback submission failed: ${response.status} ${response.statusText}`
|
|
6491
|
+
);
|
|
6492
|
+
}
|
|
6493
|
+
}
|
|
6494
|
+
async function feedbackCommand(text) {
|
|
6495
|
+
const logger = createCLILogger({});
|
|
6496
|
+
try {
|
|
6497
|
+
const config = readConfig();
|
|
6498
|
+
let anonymous;
|
|
6499
|
+
if (config?.anonymousFeedback === void 0) {
|
|
6500
|
+
const answer = await promptUser(
|
|
6501
|
+
"Include your user and project info with feedback? (y/N) "
|
|
6502
|
+
);
|
|
6503
|
+
const anonymousFeedback = !answer.toLowerCase().startsWith("y");
|
|
6504
|
+
if (config) {
|
|
6505
|
+
writeConfig({ ...config, anonymousFeedback });
|
|
6506
|
+
} else {
|
|
6507
|
+
writeConfig({
|
|
6508
|
+
token: "",
|
|
6509
|
+
email: "",
|
|
6510
|
+
appUrl: "",
|
|
6511
|
+
anonymousFeedback
|
|
6512
|
+
});
|
|
6513
|
+
}
|
|
6514
|
+
anonymous = anonymousFeedback;
|
|
6515
|
+
} else {
|
|
6516
|
+
anonymous = config.anonymousFeedback;
|
|
6517
|
+
}
|
|
6518
|
+
await feedback(text, { anonymous });
|
|
6519
|
+
logger.info("Feedback sent. Thanks!");
|
|
6520
|
+
} catch (error) {
|
|
6521
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
6522
|
+
process.exit(1);
|
|
6523
|
+
}
|
|
6524
|
+
}
|
|
6525
|
+
function promptUser(question) {
|
|
6526
|
+
return new Promise((resolve2) => {
|
|
6527
|
+
const rl = createInterface({
|
|
6528
|
+
input: process.stdin,
|
|
6529
|
+
output: process.stderr
|
|
6530
|
+
});
|
|
6531
|
+
rl.question(question, (answer) => {
|
|
6532
|
+
rl.close();
|
|
6533
|
+
resolve2(answer);
|
|
6534
|
+
});
|
|
6535
|
+
});
|
|
6536
|
+
}
|
|
6537
|
+
|
|
6467
6538
|
// src/index.ts
|
|
6468
6539
|
init_bundle();
|
|
6469
6540
|
init_auth();
|
|
6470
6541
|
init_api_client();
|
|
6542
|
+
init_config_file();
|
|
6471
6543
|
init_sse();
|
|
6472
6544
|
init_utils();
|
|
6473
6545
|
export {
|
|
@@ -6494,6 +6566,8 @@ export {
|
|
|
6494
6566
|
deployCommand,
|
|
6495
6567
|
duplicateFlow,
|
|
6496
6568
|
duplicateFlowCommand,
|
|
6569
|
+
feedback,
|
|
6570
|
+
feedbackCommand,
|
|
6497
6571
|
findExample,
|
|
6498
6572
|
getAuthHeaders,
|
|
6499
6573
|
getDeployment,
|
|
@@ -6517,6 +6591,7 @@ export {
|
|
|
6517
6591
|
parseSSEEvents,
|
|
6518
6592
|
push,
|
|
6519
6593
|
pushCommand,
|
|
6594
|
+
readConfig,
|
|
6520
6595
|
requireProjectId,
|
|
6521
6596
|
resolveBaseUrl,
|
|
6522
6597
|
run,
|
|
@@ -6530,6 +6605,7 @@ export {
|
|
|
6530
6605
|
validate,
|
|
6531
6606
|
validateCommand,
|
|
6532
6607
|
whoami,
|
|
6533
|
-
whoamiCommand
|
|
6608
|
+
whoamiCommand,
|
|
6609
|
+
writeConfig
|
|
6534
6610
|
};
|
|
6535
6611
|
//# sourceMappingURL=index.js.map
|