@epilot/cli 0.1.4 → 0.1.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.
Files changed (57) hide show
  1. package/README.md +1 -1
  2. package/dist/{access-token-56RMQQAV.js → access-token-BDNU3ZFC.js} +2 -2
  3. package/dist/{address-ILFNEEKQ.js → address-ZCYZYRP4.js} +2 -2
  4. package/dist/{address-suggestions-HBXNOBTY.js → address-suggestions-RP5N7NVQ.js} +2 -2
  5. package/dist/{ai-agents-3GVB2MHH.js → ai-agents-PLUGVZTI.js} +2 -2
  6. package/dist/{app-PMVGDA44.js → app-HZECIN6N.js} +2 -2
  7. package/dist/{audit-logs-SAD6TZ6T.js → audit-logs-JWKGNHPP.js} +2 -2
  8. package/dist/{auth-LMXCPY77.js → auth-O5LQZAG7.js} +1 -1
  9. package/dist/auth-login-NM74PQRP.js +332 -0
  10. package/dist/{automation-VF6AL6TZ.js → automation-73BC4PYK.js} +2 -2
  11. package/dist/{billing-LW6XV26L.js → billing-GQDSK4H2.js} +2 -2
  12. package/dist/bin/epilot.js +57 -59
  13. package/dist/{blueprint-manifest-GVONSIWC.js → blueprint-manifest-4M7DNWYE.js} +2 -2
  14. package/dist/{chunk-SACM5JJP.js → chunk-BJOXXFMA.js} +10 -9
  15. package/dist/{chunk-3FZ36LAB.js → chunk-HN4QDJOJ.js} +18 -15
  16. package/dist/{completion-YVPB2HSP.js → completion-RCVUCEMM.js} +3 -6
  17. package/dist/{consent-L7PPM2RS.js → consent-OJBGOI54.js} +2 -2
  18. package/dist/{customer-portal-FKEQLBZT.js → customer-portal-BDKNWKHA.js} +2 -2
  19. package/dist/{dashboard-N7ZV5LV7.js → dashboard-IAEU3JFY.js} +2 -2
  20. package/dist/{data-management-B2HKXR7L.js → data-management-UEDSGAKB.js} +2 -2
  21. package/dist/{deduplication-RY2NOUVL.js → deduplication-JJS3TOJ2.js} +2 -2
  22. package/dist/{design-KXZPNB7R.js → design-WKSDZFBJ.js} +2 -2
  23. package/dist/{document-OMWQI4SG.js → document-P5OL4NYY.js} +2 -2
  24. package/dist/{email-settings-IA36PUXF.js → email-settings-743JHCKS.js} +2 -2
  25. package/dist/{email-template-V56KH5HB.js → email-template-MW4IVDPM.js} +2 -2
  26. package/dist/{entity-3AYPUKDS.js → entity-K5X6FWJI.js} +2 -2
  27. package/dist/{entity-mapping-LQW3SXIQ.js → entity-mapping-QBJ2I2VR.js} +2 -2
  28. package/dist/{environments-W36TPCFO.js → environments-VUR7ME42.js} +2 -2
  29. package/dist/{erp-integration-3HQ7E5NA.js → erp-integration-A2KAIXUQ.js} +2 -2
  30. package/dist/{event-catalog-3L3622DH.js → event-catalog-6YEG5CEM.js} +2 -2
  31. package/dist/{file-OKYWWEU2.js → file-J6PHZ447.js} +2 -2
  32. package/dist/{iban-JASOQGKM.js → iban-DJSUCRU6.js} +2 -2
  33. package/dist/{interactive-5J6X74Q7.js → interactive-XXYFAJEI.js} +1 -1
  34. package/dist/{journey-ITMLYX23.js → journey-QJZKU3PZ.js} +2 -2
  35. package/dist/{kanban-JDRCIYF6.js → kanban-ZF4IIG7Q.js} +2 -2
  36. package/dist/{message-NI45JYMQ.js → message-WH4GD5SC.js} +2 -2
  37. package/dist/{metering-J6L5IPRJ.js → metering-FCWUZ2TC.js} +2 -2
  38. package/dist/{notes-WSEYYM2I.js → notes-KKVPGK7K.js} +2 -2
  39. package/dist/{notification-GOGQMIRR.js → notification-4MVAZTRP.js} +2 -2
  40. package/dist/{organization-IFUJHPGJ.js → organization-2UT2KFMB.js} +2 -2
  41. package/dist/{partner-directory-O5HSDE2K.js → partner-directory-SUNW4XN7.js} +2 -2
  42. package/dist/{permissions-7MMSNXB5.js → permissions-36VGB4BQ.js} +2 -2
  43. package/dist/{pricing-Z7HT4ROJ.js → pricing-RCNFEEHO.js} +2 -2
  44. package/dist/{pricing-tier-MMWT57MJ.js → pricing-tier-MNCLLXD5.js} +2 -2
  45. package/dist/{purpose-BGXEOLJ7.js → purpose-3JN63WTQ.js} +2 -2
  46. package/dist/{sandbox-PQW5425Q.js → sandbox-C676YDRV.js} +2 -2
  47. package/dist/{submission-5OFXHA3T.js → submission-5XTNMMCK.js} +2 -2
  48. package/dist/{targeting-ESL32NRT.js → targeting-C52KV6IW.js} +2 -2
  49. package/dist/{template-variables-DHSWLYWH.js → template-variables-5SKJEJF4.js} +2 -2
  50. package/dist/{upgrade-GNXLL2NI.js → upgrade-VJCKIUNZ.js} +1 -1
  51. package/dist/{user-HCHAYBZU.js → user-DYAR3N6L.js} +2 -2
  52. package/dist/{validation-rules-CQRPRNDS.js → validation-rules-LDAOUPOO.js} +2 -2
  53. package/dist/{webhooks-OOLV3K4A.js → webhooks-MT2P33A2.js} +2 -2
  54. package/dist/{workflow-GHNKO7IJ.js → workflow-YGWGE6L4.js} +2 -2
  55. package/dist/{workflow-definition-XPEHPQVQ.js → workflow-definition-JG54ZWGL.js} +2 -2
  56. package/package.json +1 -1
  57. package/dist/auth-login-J2R6SME7.js +0 -194
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-SACM5JJP.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-3FZ36LAB.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
8
  import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/workflow.ts
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-SACM5JJP.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-3FZ36LAB.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
8
  import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/workflow-definition.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "CLI for epilot APIs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,194 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- saveCredentials
4
- } from "./chunk-RSA7K5HB.js";
5
- import "./chunk-PDMWUCWD.js";
6
- import {
7
- BOLD,
8
- CYAN,
9
- DIM,
10
- GREEN,
11
- RED,
12
- RESET,
13
- YELLOW
14
- } from "./chunk-6RBLA5YE.js";
15
-
16
- // src/commands/auth-login.ts
17
- import { defineCommand } from "citty";
18
- import { randomBytes } from "crypto";
19
- import { createServer } from "http";
20
- var auth_login_default = defineCommand({
21
- meta: { name: "login", description: "Authenticate with epilot" },
22
- args: {
23
- token: { type: "string", description: "Manually provide a token instead of browser login" },
24
- profile: { type: "string", description: "Save credentials to this profile" }
25
- },
26
- run: async ({ args }) => {
27
- const profileName = args.profile || process.env.EPILOT_PROFILE;
28
- if (args.token) {
29
- saveCredentials({ token: args.token }, profileName);
30
- const suffix = profileName ? ` to profile "${profileName}"` : "";
31
- process.stdout.write(`${GREEN}Token saved${suffix}.${RESET}
32
- `);
33
- return;
34
- }
35
- if (!process.stdin.isTTY) {
36
- process.stderr.write(`${RED}Browser login requires an interactive terminal.${RESET}
37
- `);
38
- process.stderr.write(
39
- `Use ${BOLD}epilot auth login --token <token>${RESET} or ${BOLD}epilot auth token${RESET} instead.
40
- `
41
- );
42
- process.exit(1);
43
- }
44
- const token = await browserLogin(profileName);
45
- if (token) {
46
- process.stdout.write(`${GREEN}${BOLD}Login successful!${RESET}
47
- `);
48
- } else {
49
- process.stderr.write(`${RED}Login failed or was cancelled.${RESET}
50
- `);
51
- process.exit(1);
52
- }
53
- }
54
- });
55
- var browserLogin = async (profileName) => {
56
- const state = randomBytes(32).toString("hex");
57
- const verificationCode = randomBytes(3).toString("hex").toUpperCase();
58
- const suffix = profileName ? ` ${DIM}(profile: ${profileName})${RESET}` : "";
59
- process.stdout.write(`
60
- ${BOLD}epilot CLI Login${RESET}${suffix}
61
-
62
- `);
63
- process.stdout.write(`This will open your browser to authenticate with epilot.
64
- `);
65
- process.stdout.write(`
66
- `);
67
- process.stdout.write(` ${YELLOW}Verification code: ${BOLD}${verificationCode}${RESET}
68
- `);
69
- process.stdout.write(`
70
- `);
71
- process.stdout.write(`${DIM}Verify this code matches what is shown in your browser after login.${RESET}
72
- `);
73
- process.stdout.write(`${DIM}This ensures you are logging into the correct CLI session.${RESET}
74
- `);
75
- process.stdout.write(`
76
- `);
77
- const { confirm } = await import("@inquirer/prompts");
78
- const proceed = await confirm({ message: "Open browser to log in?", default: true });
79
- if (!proceed) {
80
- return null;
81
- }
82
- return new Promise((resolve) => {
83
- let settled = false;
84
- let timeoutId;
85
- const done = (token) => {
86
- if (settled) return;
87
- settled = true;
88
- clearTimeout(timeoutId);
89
- server.close();
90
- resolve(token);
91
- };
92
- const onServerListening = async () => {
93
- const address = server.address();
94
- if (!address || typeof address === "string") {
95
- done(null);
96
- return;
97
- }
98
- const port = address.port;
99
- const callbackUrl = `http://localhost:${port}/callback`;
100
- const loginUrl = `https://portal.epilot.cloud/login?cli_callback=${encodeURIComponent(callbackUrl)}&state=${state}&code=${verificationCode}`;
101
- process.stdout.write(`
102
- ${DIM}Login URL: ${loginUrl}${RESET}
103
-
104
- `);
105
- try {
106
- const open = (await import("open")).default;
107
- await open(loginUrl);
108
- process.stdout.write(`${CYAN}Browser opened.${RESET} Waiting for authentication...
109
- `);
110
- } catch {
111
- process.stdout.write(`Could not open browser. Please visit this URL manually:
112
-
113
- ${loginUrl}
114
-
115
- `);
116
- }
117
- process.stdout.write(`
118
- ${DIM}Or paste a token manually:${RESET}
119
- `);
120
- try {
121
- const { password } = await import("@inquirer/prompts");
122
- const token = await password({ message: "Token:" });
123
- if (token?.trim()) {
124
- saveCredentials({ token: token.trim() }, profileName);
125
- done(token.trim());
126
- }
127
- } catch {
128
- }
129
- timeoutId = setTimeout(
130
- () => {
131
- process.stderr.write(`
132
- ${RED}Login timed out after 5 minutes.${RESET}
133
- `);
134
- done(null);
135
- },
136
- 5 * 60 * 1e3
137
- );
138
- timeoutId.unref();
139
- };
140
- const server = createServer((req, res) => {
141
- const url = new URL(req.url, "http://localhost");
142
- if (url.pathname === "/callback") {
143
- const token = url.searchParams.get("token");
144
- const returnedState = url.searchParams.get("state");
145
- const orgId = url.searchParams.get("org_id");
146
- const userId = url.searchParams.get("user_id");
147
- const name = url.searchParams.get("name");
148
- if (returnedState && returnedState !== state) {
149
- res.writeHead(403, { "Content-Type": "text/html" });
150
- res.end(
151
- "<html><body><h1>Login failed</h1><p>Invalid state parameter. This request may not have originated from your CLI session.</p></body></html>"
152
- );
153
- return;
154
- }
155
- if (!returnedState) {
156
- process.stderr.write(
157
- `${YELLOW}Warning: Login portal did not return state parameter. CSRF protection is not active.${RESET}
158
- `
159
- );
160
- }
161
- if (token) {
162
- saveCredentials(
163
- {
164
- token,
165
- org_id: orgId ?? void 0,
166
- user_id: userId ?? void 0,
167
- name: name ?? void 0
168
- },
169
- profileName
170
- );
171
- res.writeHead(200, { "Content-Type": "text/html" });
172
- res.end(
173
- `<html><body><h1>Login successful!</h1><p>Verification code: <strong>${verificationCode}</strong></p><p>You can close this tab.</p></body></html>`
174
- );
175
- done(token);
176
- } else {
177
- res.writeHead(400, { "Content-Type": "text/html" });
178
- res.end("<html><body><h1>Login failed</h1><p>No token received.</p></body></html>");
179
- done(null);
180
- }
181
- } else {
182
- res.writeHead(404);
183
- res.end();
184
- }
185
- });
186
- server.unref();
187
- server.listen(0, () => {
188
- onServerListening().catch(() => done(null));
189
- });
190
- });
191
- };
192
- export {
193
- auth_login_default as default
194
- };