@epilot/cli 0.1.3 → 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 (60) hide show
  1. package/README.md +18 -4
  2. package/dist/{access-token-F2VH6TNQ.js → access-token-BDNU3ZFC.js} +3 -3
  3. package/dist/{address-YBOAFFFH.js → address-ZCYZYRP4.js} +3 -3
  4. package/dist/{address-suggestions-ITPRYJSF.js → address-suggestions-RP5N7NVQ.js} +3 -3
  5. package/dist/{ai-agents-EBWNYR5R.js → ai-agents-PLUGVZTI.js} +3 -3
  6. package/dist/{app-WOAQAMSE.js → app-HZECIN6N.js} +3 -3
  7. package/dist/{audit-logs-OAUUPKTJ.js → audit-logs-JWKGNHPP.js} +3 -3
  8. package/dist/{auth-NEBRZ66K.js → auth-O5LQZAG7.js} +3 -3
  9. package/dist/auth-login-NM74PQRP.js +332 -0
  10. package/dist/{auth-token-W6GXKHXB.js → auth-token-VSNRXUBI.js} +1 -1
  11. package/dist/{automation-52ONEM6D.js → automation-73BC4PYK.js} +3 -3
  12. package/dist/{billing-2RED3OVH.js → billing-GQDSK4H2.js} +3 -3
  13. package/dist/bin/epilot.js +60 -59
  14. package/dist/{blueprint-manifest-4VTVMR42.js → blueprint-manifest-4M7DNWYE.js} +3 -3
  15. package/dist/{chunk-TKZLQD2B.js → chunk-6RBLA5YE.js} +3 -1
  16. package/dist/{chunk-5CTRM3JQ.js → chunk-BJOXXFMA.js} +12 -11
  17. package/dist/{chunk-4VITQVW2.js → chunk-HN4QDJOJ.js} +19 -16
  18. package/dist/{completion-XN3BD2LS.js → completion-RCVUCEMM.js} +77 -9
  19. package/dist/{consent-25X3PFNT.js → consent-OJBGOI54.js} +3 -3
  20. package/dist/{customer-portal-T6VNRPQY.js → customer-portal-BDKNWKHA.js} +3 -3
  21. package/dist/{dashboard-MBTUKEVN.js → dashboard-IAEU3JFY.js} +3 -3
  22. package/dist/{data-management-ZHPS67MI.js → data-management-UEDSGAKB.js} +3 -3
  23. package/dist/{deduplication-L2UABHUX.js → deduplication-JJS3TOJ2.js} +3 -3
  24. package/dist/{design-ELKIZCND.js → design-WKSDZFBJ.js} +3 -3
  25. package/dist/{document-VF2C5OPK.js → document-P5OL4NYY.js} +3 -3
  26. package/dist/{email-settings-TM6TIDZQ.js → email-settings-743JHCKS.js} +3 -3
  27. package/dist/{email-template-S7NLUNON.js → email-template-MW4IVDPM.js} +3 -3
  28. package/dist/{entity-5AAD2R3S.js → entity-K5X6FWJI.js} +3 -3
  29. package/dist/{entity-mapping-UOFXQLQ2.js → entity-mapping-QBJ2I2VR.js} +3 -3
  30. package/dist/{environments-STU24LWT.js → environments-VUR7ME42.js} +3 -3
  31. package/dist/{erp-integration-DMPYQNVW.js → erp-integration-A2KAIXUQ.js} +3 -3
  32. package/dist/{event-catalog-HGSD3RZW.js → event-catalog-6YEG5CEM.js} +3 -3
  33. package/dist/{file-G355J7IL.js → file-J6PHZ447.js} +3 -3
  34. package/dist/{iban-FIL4TCSN.js → iban-DJSUCRU6.js} +3 -3
  35. package/dist/{interactive-RWCSFGXL.js → interactive-XXYFAJEI.js} +2 -2
  36. package/dist/{journey-4IZDKDY7.js → journey-QJZKU3PZ.js} +3 -3
  37. package/dist/{kanban-DNIP4AAI.js → kanban-ZF4IIG7Q.js} +3 -3
  38. package/dist/{message-W4TZ32YH.js → message-WH4GD5SC.js} +3 -3
  39. package/dist/{metering-GKGJZTDF.js → metering-FCWUZ2TC.js} +3 -3
  40. package/dist/{notes-AS7BD3B6.js → notes-KKVPGK7K.js} +3 -3
  41. package/dist/{notification-N4ACDEK7.js → notification-4MVAZTRP.js} +3 -3
  42. package/dist/{organization-IYNBC4SB.js → organization-2UT2KFMB.js} +3 -3
  43. package/dist/{partner-directory-DZX32S4J.js → partner-directory-SUNW4XN7.js} +3 -3
  44. package/dist/{permissions-Z7KVPSVL.js → permissions-36VGB4BQ.js} +3 -3
  45. package/dist/{pricing-OLSQRQZN.js → pricing-RCNFEEHO.js} +3 -3
  46. package/dist/{pricing-tier-IP274TML.js → pricing-tier-MNCLLXD5.js} +3 -3
  47. package/dist/{profile-PPVSNNBG.js → profile-MZ3VK7PO.js} +1 -1
  48. package/dist/{purpose-YCIEYFCH.js → purpose-3JN63WTQ.js} +3 -3
  49. package/dist/{sandbox-AKFR5LEQ.js → sandbox-C676YDRV.js} +3 -3
  50. package/dist/{submission-XONDJGXI.js → submission-5XTNMMCK.js} +3 -3
  51. package/dist/{targeting-QWHVJCWI.js → targeting-C52KV6IW.js} +3 -3
  52. package/dist/{template-variables-Q3J3IPSF.js → template-variables-5SKJEJF4.js} +3 -3
  53. package/dist/upgrade-VJCKIUNZ.js +124 -0
  54. package/dist/{user-QNPACYI3.js → user-DYAR3N6L.js} +3 -3
  55. package/dist/{validation-rules-XT3SRBJ3.js → validation-rules-LDAOUPOO.js} +3 -3
  56. package/dist/{webhooks-RH5VYEY6.js → webhooks-MT2P33A2.js} +3 -3
  57. package/dist/{workflow-BKSEFDUM.js → workflow-YGWGE6L4.js} +3 -3
  58. package/dist/{workflow-definition-DGEBEIGG.js → workflow-definition-JG54ZWGL.js} +3 -3
  59. package/package.json +1 -1
  60. package/dist/auth-login-QQBH7BVA.js +0 -140
@@ -1,140 +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
- DIM,
9
- GREEN,
10
- RED,
11
- RESET
12
- } from "./chunk-TKZLQD2B.js";
13
-
14
- // src/commands/auth-login.ts
15
- import { defineCommand } from "citty";
16
- import { createServer } from "http";
17
- var auth_login_default = defineCommand({
18
- meta: { name: "login", description: "Authenticate with epilot" },
19
- args: {
20
- token: { type: "string", description: "Manually provide a token instead of browser login" },
21
- profile: { type: "string", description: "Save credentials to this profile" }
22
- },
23
- run: async ({ args }) => {
24
- const profileName = args.profile || process.env.EPILOT_PROFILE;
25
- if (args.token) {
26
- saveCredentials({ token: args.token }, profileName);
27
- const suffix = profileName ? ` to profile "${profileName}"` : "";
28
- process.stdout.write(`${GREEN}Token saved${suffix}.${RESET}
29
- `);
30
- return;
31
- }
32
- if (profileName) {
33
- process.stdout.write(`${BOLD}Opening browser for epilot login (profile: ${profileName})...${RESET}
34
- `);
35
- } else {
36
- process.stdout.write(`${BOLD}Opening browser for epilot login...${RESET}
37
- `);
38
- }
39
- const token = await browserLogin(profileName);
40
- if (token) {
41
- process.stdout.write(`${GREEN}${BOLD}Login successful!${RESET}
42
- `);
43
- } else {
44
- process.stderr.write(`${RED}Login failed or was cancelled.${RESET}
45
- `);
46
- process.exit(1);
47
- }
48
- }
49
- });
50
- var browserLogin = (profileName) => {
51
- let settled = false;
52
- let timeoutId;
53
- return new Promise((resolve) => {
54
- const done = (token) => {
55
- if (settled) return;
56
- settled = true;
57
- clearTimeout(timeoutId);
58
- server.close();
59
- resolve(token);
60
- };
61
- const onServerListening = async () => {
62
- const address = server.address();
63
- if (!address || typeof address === "string") {
64
- done(null);
65
- return;
66
- }
67
- const port = address.port;
68
- const callbackUrl = `http://localhost:${port}/callback`;
69
- const loginUrl = `https://portal.epilot.cloud/login?cli_callback=${encodeURIComponent(callbackUrl)}`;
70
- process.stdout.write(`
71
- ${DIM}Login URL: ${loginUrl}${RESET}
72
-
73
- `);
74
- try {
75
- const open = (await import("open")).default;
76
- await open(loginUrl);
77
- process.stdout.write("Browser opened. Waiting for authentication...\n");
78
- } catch {
79
- process.stdout.write(`Could not open browser. Please visit this URL manually:
80
-
81
- ${loginUrl}
82
-
83
- `);
84
- }
85
- if (process.stdin.isTTY) {
86
- process.stdout.write(`
87
- ${DIM}Or paste a token manually:${RESET}
88
- `);
89
- try {
90
- const { password } = await import("@inquirer/prompts");
91
- const token = await password({ message: "Token:" });
92
- if (token?.trim()) {
93
- saveCredentials({ token: token.trim() }, profileName);
94
- done(token.trim());
95
- }
96
- } catch {
97
- }
98
- }
99
- timeoutId = setTimeout(() => done(null), 5 * 60 * 1e3);
100
- timeoutId.unref();
101
- };
102
- const server = createServer((req, res) => {
103
- const url = new URL(req.url, "http://localhost");
104
- if (url.pathname === "/callback") {
105
- const token = url.searchParams.get("token");
106
- const orgId = url.searchParams.get("org_id");
107
- const userId = url.searchParams.get("user_id");
108
- const name = url.searchParams.get("name");
109
- if (token) {
110
- saveCredentials(
111
- {
112
- token,
113
- org_id: orgId ?? void 0,
114
- user_id: userId ?? void 0,
115
- name: name ?? void 0
116
- },
117
- profileName
118
- );
119
- res.writeHead(200, { "Content-Type": "text/html" });
120
- res.end("<html><body><h1>Login successful!</h1><p>You can close this tab.</p></body></html>");
121
- done(token);
122
- } else {
123
- res.writeHead(400, { "Content-Type": "text/html" });
124
- res.end("<html><body><h1>Login failed</h1><p>No token received.</p></body></html>");
125
- done(null);
126
- }
127
- } else {
128
- res.writeHead(404);
129
- res.end();
130
- }
131
- });
132
- server.unref();
133
- server.listen(0, () => {
134
- onServerListening().catch(() => done(null));
135
- });
136
- });
137
- };
138
- export {
139
- auth_login_default as default
140
- };