@epilot/cli 0.1.0 → 0.1.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/README.md +91 -101
- package/dist/{access-token-OG5AR7UB.js → access-token-F2VH6TNQ.js} +4 -4
- package/dist/{address-QUSMK5GV.js → address-YBOAFFFH.js} +4 -4
- package/dist/{address-suggestions-E5SQNUS5.js → address-suggestions-ITPRYJSF.js} +4 -4
- package/dist/{ai-agents-PM42SJY3.js → ai-agents-EBWNYR5R.js} +4 -4
- package/dist/{app-YTM3XAJL.js → app-WOAQAMSE.js} +4 -4
- package/dist/{audit-logs-NXP7GFKX.js → audit-logs-OAUUPKTJ.js} +4 -4
- package/dist/{auth-CCBTXH5U.js → auth-NEBRZ66K.js} +4 -4
- package/dist/{auth-login-2ZIXM47J.js → auth-login-QQBH7BVA.js} +42 -39
- package/dist/{auth-token-OS4BEEVZ.js → auth-token-W6GXKHXB.js} +2 -2
- package/dist/{automation-TDJASTEV.js → automation-52ONEM6D.js} +4 -4
- package/dist/{billing-M4MRBLEK.js → billing-2RED3OVH.js} +4 -4
- package/dist/bin/epilot.js +162 -49
- package/dist/{blueprint-manifest-NQL7NRMV.js → blueprint-manifest-4VTVMR42.js} +4 -4
- package/dist/{chunk-RC3GCXCI.js → chunk-4VITQVW2.js} +2 -4
- package/dist/{chunk-57PPARIW.js → chunk-5CTRM3JQ.js} +24 -21
- package/dist/{chunk-IST42ZNL.js → chunk-PDMWUCWD.js} +1 -1
- package/dist/{chunk-5WUPDZ5D.js → chunk-RSA7K5HB.js} +1 -1
- package/dist/{consent-KQ7MJAS6.js → consent-25X3PFNT.js} +4 -4
- package/dist/{customer-portal-VUVSKWAQ.js → customer-portal-T6VNRPQY.js} +4 -4
- package/dist/{dashboard-GVR4XNGR.js → dashboard-MBTUKEVN.js} +4 -4
- package/dist/{data-management-2RD3DLOS.js → data-management-ZHPS67MI.js} +4 -4
- package/dist/{deduplication-PY77EINR.js → deduplication-L2UABHUX.js} +4 -4
- package/dist/{design-M4FP2K5R.js → design-ELKIZCND.js} +4 -4
- package/dist/{document-P4QA7LEZ.js → document-VF2C5OPK.js} +4 -4
- package/dist/{email-settings-7HGGRCCM.js → email-settings-TM6TIDZQ.js} +4 -4
- package/dist/{email-template-3HXQI4CH.js → email-template-S7NLUNON.js} +4 -4
- package/dist/{entity-XUESZBPJ.js → entity-5AAD2R3S.js} +4 -4
- package/dist/{entity-mapping-JBKWWBH2.js → entity-mapping-UOFXQLQ2.js} +4 -4
- package/dist/{environments-KKOS7ONY.js → environments-STU24LWT.js} +4 -4
- package/dist/{erp-integration-YTOWHCAW.js → erp-integration-DMPYQNVW.js} +4 -4
- package/dist/{event-catalog-UKLZUGC4.js → event-catalog-HGSD3RZW.js} +4 -4
- package/dist/{file-IFZNZ547.js → file-G355J7IL.js} +4 -4
- package/dist/{iban-X2IW2NWU.js → iban-FIL4TCSN.js} +4 -4
- package/dist/{interactive-46ICLQKL.js → interactive-RWCSFGXL.js} +1 -1
- package/dist/{journey-JU6X2KMX.js → journey-4IZDKDY7.js} +4 -4
- package/dist/{kanban-VHUU44PM.js → kanban-DNIP4AAI.js} +4 -4
- package/dist/{message-AOUWJ4YX.js → message-W4TZ32YH.js} +4 -4
- package/dist/{metering-RDS3XBD5.js → metering-GKGJZTDF.js} +4 -4
- package/dist/{notes-WE2UC75B.js → notes-AS7BD3B6.js} +4 -4
- package/dist/{notification-FKFNBHYZ.js → notification-N4ACDEK7.js} +4 -4
- package/dist/{organization-LMNFF6BX.js → organization-IYNBC4SB.js} +4 -4
- package/dist/{partner-directory-IIZVQDXJ.js → partner-directory-DZX32S4J.js} +4 -4
- package/dist/{permissions-AYCMVM7Y.js → permissions-Z7KVPSVL.js} +4 -4
- package/dist/{pricing-PS26FWBS.js → pricing-OLSQRQZN.js} +4 -4
- package/dist/{pricing-tier-FBXWQ6T3.js → pricing-tier-IP274TML.js} +4 -4
- package/dist/{profile-5Q5YARG7.js → profile-PPVSNNBG.js} +1 -1
- package/dist/{purpose-HE4E4SVU.js → purpose-YCIEYFCH.js} +4 -4
- package/dist/{sandbox-Z7BU4UAD.js → sandbox-AKFR5LEQ.js} +4 -4
- package/dist/{submission-MWVDF2ZB.js → submission-XONDJGXI.js} +4 -4
- package/dist/{targeting-7NM5GDJ6.js → targeting-QWHVJCWI.js} +4 -4
- package/dist/{template-variables-AJAR7PAV.js → template-variables-Q3J3IPSF.js} +4 -4
- package/dist/{user-A26XQXG3.js → user-QNPACYI3.js} +4 -4
- package/dist/{validation-rules-VZTISEG2.js → validation-rules-XT3SRBJ3.js} +4 -4
- package/dist/{webhooks-RXH67WZ3.js → webhooks-RH5VYEY6.js} +4 -4
- package/dist/{workflow-G4FUUGZQ.js → workflow-BKSEFDUM.js} +4 -4
- package/dist/{workflow-definition-LJYLMMGD.js → workflow-definition-DGEBEIGG.js} +4 -4
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,119 +1,109 @@
|
|
|
1
1
|
# epilot CLI
|
|
2
2
|
|
|
3
|
-
CLI for
|
|
3
|
+
CLI for epilot APIs. Call any epilot API operation directly from the command line.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
+
# Run directly (no install needed)
|
|
8
9
|
npx epilot --help
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Or install globally:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install -g epilot
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Quick Start
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
# Authenticate
|
|
21
|
-
epilot auth login
|
|
22
|
-
|
|
23
|
-
# List entity schemas
|
|
24
|
-
epilot entity listSchemas
|
|
25
|
-
|
|
26
|
-
# Get an entity by id
|
|
27
|
-
epilot entity getEntity -p slug=contact -p id=abc123
|
|
28
|
-
|
|
29
|
-
# Same with positional args
|
|
30
|
-
epilot entity getEntity contact abc123
|
|
31
10
|
|
|
32
|
-
#
|
|
33
|
-
epilot
|
|
34
|
-
|
|
35
|
-
# Pipe body from file
|
|
36
|
-
cat query.json | epilot entity searchEntities
|
|
37
|
-
|
|
38
|
-
# Filter response with JSONata
|
|
39
|
-
epilot user getMeV2 --jsonata 'email'
|
|
40
|
-
|
|
41
|
-
# Raw JSON output (for scripting)
|
|
42
|
-
epilot entity listSchemas --json | jq '.results[].slug'
|
|
11
|
+
# Or install globally
|
|
12
|
+
npm install -g @epilot/cli # scoped package (same thing)
|
|
43
13
|
```
|
|
44
14
|
|
|
45
15
|
## Usage
|
|
46
16
|
|
|
47
17
|
<!-- usage-help -->
|
|
48
18
|
```
|
|
49
|
-
CLI for epilot APIs
|
|
50
|
-
|
|
51
|
-
USAGE
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
--
|
|
62
|
-
|
|
19
|
+
epilot v0.1.2 — CLI for epilot APIs
|
|
20
|
+
|
|
21
|
+
USAGE
|
|
22
|
+
epilot <api> <operationId> [params...] [flags]
|
|
23
|
+
epilot <api> List operations for an API
|
|
24
|
+
epilot <api> <op> --help Show operation details
|
|
25
|
+
|
|
26
|
+
FLAGS
|
|
27
|
+
-t, --token <token> Bearer token for authentication
|
|
28
|
+
--profile <name> Use a named profile (or EPILOT_PROFILE)
|
|
29
|
+
-s, --server <url> Override server base URL
|
|
30
|
+
--json Output raw JSON (no formatting)
|
|
31
|
+
-v, --verbose Verbose output (show request details)
|
|
32
|
+
--jsonata <expr> JSONata expression to transform response
|
|
33
|
+
--no-interactive Disable interactive prompts
|
|
34
|
+
|
|
35
|
+
PARAMETER FLAGS
|
|
36
|
+
-p key=value Set a named parameter
|
|
37
|
+
-d '{...}' Request body JSON
|
|
38
|
+
-H 'Key: Value' Custom header
|
|
39
|
+
-i, --include Include response headers in output
|
|
63
40
|
|
|
64
41
|
COMMANDS
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
42
|
+
auth login Authenticate with epilot (browser)
|
|
43
|
+
auth token Store an API token directly
|
|
44
|
+
auth status Show authentication status
|
|
45
|
+
auth logout Remove stored credentials
|
|
46
|
+
profile Manage named profiles
|
|
47
|
+
completion Generate shell completion scripts
|
|
48
|
+
|
|
49
|
+
APIs
|
|
50
|
+
access-token Access Token API
|
|
51
|
+
address Address API
|
|
52
|
+
address-suggestions Address Suggestions API
|
|
53
|
+
ai-agents AI Agents API - OpenAPI 3.0
|
|
54
|
+
app App API
|
|
55
|
+
audit-logs Audit Log
|
|
56
|
+
automation Automation API
|
|
57
|
+
billing Billing API
|
|
58
|
+
blueprint-manifest Blueprint Manifest API
|
|
59
|
+
consent Consent API
|
|
60
|
+
customer-portal Portal API
|
|
61
|
+
dashboard Dashboard API
|
|
62
|
+
data-management Data Management API
|
|
63
|
+
deduplication Deduplication API
|
|
64
|
+
design Design Builder API v2
|
|
65
|
+
document Document API
|
|
66
|
+
email-settings Messaging Settings API
|
|
67
|
+
email-template Email template API
|
|
68
|
+
entity Entity API
|
|
69
|
+
entity-mapping Entity Mapping API
|
|
70
|
+
environments Environments API
|
|
71
|
+
erp-integration ERP Integration API
|
|
72
|
+
event-catalog Event Catalog API
|
|
73
|
+
file File API
|
|
74
|
+
iban Iban API
|
|
75
|
+
journey Journey API
|
|
76
|
+
kanban Kanban API
|
|
77
|
+
message Message API
|
|
78
|
+
metering Metering API
|
|
79
|
+
notes Notes API
|
|
80
|
+
notification Notification API
|
|
81
|
+
organization Organization API
|
|
82
|
+
partner-directory Partner API
|
|
83
|
+
permissions Permissions API
|
|
84
|
+
pricing Pricing API
|
|
85
|
+
pricing-tier Pricing Tier API
|
|
86
|
+
purpose Purpose API
|
|
87
|
+
sandbox Sandbox API
|
|
88
|
+
submission Submission API
|
|
89
|
+
targeting Targeting API
|
|
90
|
+
template-variables Template Variables API
|
|
91
|
+
user User API
|
|
92
|
+
validation-rules Validation Rules API
|
|
93
|
+
webhooks Webhooks
|
|
94
|
+
workflow Workflows Executions
|
|
95
|
+
workflow-definition Workflows Definitions
|
|
96
|
+
|
|
97
|
+
EXAMPLES
|
|
98
|
+
$ epilot auth login
|
|
99
|
+
$ epilot user getMeV2
|
|
100
|
+
$ epilot entity getEntity contact abc123
|
|
101
|
+
$ epilot entity searchEntities -d '{"q":"*"}'
|
|
102
|
+
$ epilot entity searchEntities --jsonata 'results[0]._title'
|
|
103
|
+
$ echo '{"q":"*"}' | epilot entity searchEntities
|
|
104
|
+
|
|
105
|
+
Run epilot <api> to list available operations.
|
|
106
|
+
Run epilot <api> <operationId> --help for operation details.
|
|
117
107
|
```
|
|
118
108
|
<!-- /usage-help -->
|
|
119
109
|
|
|
@@ -279,7 +269,7 @@ Provides tab completion for API names, operation IDs, and flags.
|
|
|
279
269
|
|
|
280
270
|
## API Reference
|
|
281
271
|
|
|
282
|
-
Full documentation with sample calls and responses for all
|
|
272
|
+
Full documentation with sample calls and responses for all APIs:
|
|
283
273
|
|
|
284
274
|
[**docs/index.md**](./docs/index.md)
|
|
285
275
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5CTRM3JQ.js";
|
|
5
|
+
import "./chunk-RSA7K5HB.js";
|
|
6
|
+
import "./chunk-PDMWUCWD.js";
|
|
7
|
+
import "./chunk-4VITQVW2.js";
|
|
8
8
|
import "./chunk-TKZLQD2B.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/apis/access-token.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5CTRM3JQ.js";
|
|
5
|
+
import "./chunk-RSA7K5HB.js";
|
|
6
|
+
import "./chunk-PDMWUCWD.js";
|
|
7
|
+
import "./chunk-4VITQVW2.js";
|
|
8
8
|
import "./chunk-TKZLQD2B.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/apis/address.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5CTRM3JQ.js";
|
|
5
|
+
import "./chunk-RSA7K5HB.js";
|
|
6
|
+
import "./chunk-PDMWUCWD.js";
|
|
7
|
+
import "./chunk-4VITQVW2.js";
|
|
8
8
|
import "./chunk-TKZLQD2B.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/apis/address-suggestions.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5CTRM3JQ.js";
|
|
5
|
+
import "./chunk-RSA7K5HB.js";
|
|
6
|
+
import "./chunk-PDMWUCWD.js";
|
|
7
|
+
import "./chunk-4VITQVW2.js";
|
|
8
8
|
import "./chunk-TKZLQD2B.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/apis/ai-agents.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5CTRM3JQ.js";
|
|
5
|
+
import "./chunk-RSA7K5HB.js";
|
|
6
|
+
import "./chunk-PDMWUCWD.js";
|
|
7
|
+
import "./chunk-4VITQVW2.js";
|
|
8
8
|
import "./chunk-TKZLQD2B.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/apis/app.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5CTRM3JQ.js";
|
|
5
|
+
import "./chunk-RSA7K5HB.js";
|
|
6
|
+
import "./chunk-PDMWUCWD.js";
|
|
7
|
+
import "./chunk-4VITQVW2.js";
|
|
8
8
|
import "./chunk-TKZLQD2B.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/apis/audit-logs.ts
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
loadCredentials,
|
|
4
4
|
removeCredentials
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-RSA7K5HB.js";
|
|
6
|
+
import "./chunk-PDMWUCWD.js";
|
|
7
7
|
import {
|
|
8
8
|
BOLD,
|
|
9
9
|
DIM,
|
|
@@ -21,8 +21,8 @@ var auth_default = defineCommand({
|
|
|
21
21
|
description: "Manage authentication"
|
|
22
22
|
},
|
|
23
23
|
subCommands: {
|
|
24
|
-
login: () => import("./auth-login-
|
|
25
|
-
token: () => import("./auth-token-
|
|
24
|
+
login: () => import("./auth-login-QQBH7BVA.js").then((m) => m.default),
|
|
25
|
+
token: () => import("./auth-token-W6GXKHXB.js").then((m) => m.default),
|
|
26
26
|
logout: defineCommand({
|
|
27
27
|
meta: { name: "logout", description: "Remove stored credentials" },
|
|
28
28
|
run: () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
saveCredentials
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-RSA7K5HB.js";
|
|
5
|
+
import "./chunk-PDMWUCWD.js";
|
|
6
6
|
import {
|
|
7
7
|
BOLD,
|
|
8
8
|
DIM,
|
|
@@ -47,10 +47,10 @@ var auth_login_default = defineCommand({
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
var browserLogin =
|
|
50
|
+
var browserLogin = (profileName) => {
|
|
51
51
|
let settled = false;
|
|
52
52
|
let timeoutId;
|
|
53
|
-
return new Promise(
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
54
|
const done = (token) => {
|
|
55
55
|
if (settled) return;
|
|
56
56
|
settled = true;
|
|
@@ -58,35 +58,7 @@ var browserLogin = async (profileName) => {
|
|
|
58
58
|
server.close();
|
|
59
59
|
resolve(token);
|
|
60
60
|
};
|
|
61
|
-
const
|
|
62
|
-
const url = new URL(req.url, `http://localhost`);
|
|
63
|
-
if (url.pathname === "/callback") {
|
|
64
|
-
const token = url.searchParams.get("token");
|
|
65
|
-
const orgId = url.searchParams.get("org_id");
|
|
66
|
-
const userId = url.searchParams.get("user_id");
|
|
67
|
-
const name = url.searchParams.get("name");
|
|
68
|
-
if (token) {
|
|
69
|
-
saveCredentials({
|
|
70
|
-
token,
|
|
71
|
-
org_id: orgId ?? void 0,
|
|
72
|
-
user_id: userId ?? void 0,
|
|
73
|
-
name: name ?? void 0
|
|
74
|
-
}, profileName);
|
|
75
|
-
res.writeHead(200, { "Content-Type": "text/html" });
|
|
76
|
-
res.end("<html><body><h1>Login successful!</h1><p>You can close this tab.</p></body></html>");
|
|
77
|
-
done(token);
|
|
78
|
-
} else {
|
|
79
|
-
res.writeHead(400, { "Content-Type": "text/html" });
|
|
80
|
-
res.end("<html><body><h1>Login failed</h1><p>No token received.</p></body></html>");
|
|
81
|
-
done(null);
|
|
82
|
-
}
|
|
83
|
-
} else {
|
|
84
|
-
res.writeHead(404);
|
|
85
|
-
res.end();
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
server.unref();
|
|
89
|
-
server.listen(0, async () => {
|
|
61
|
+
const onServerListening = async () => {
|
|
90
62
|
const address = server.address();
|
|
91
63
|
if (!address || typeof address === "string") {
|
|
92
64
|
done(null);
|
|
@@ -102,16 +74,13 @@ ${DIM}Login URL: ${loginUrl}${RESET}
|
|
|
102
74
|
try {
|
|
103
75
|
const open = (await import("open")).default;
|
|
104
76
|
await open(loginUrl);
|
|
105
|
-
process.stdout.write(
|
|
106
|
-
`);
|
|
77
|
+
process.stdout.write("Browser opened. Waiting for authentication...\n");
|
|
107
78
|
} catch {
|
|
108
|
-
process.stdout.write(
|
|
109
|
-
`Could not open browser. Please visit this URL manually:
|
|
79
|
+
process.stdout.write(`Could not open browser. Please visit this URL manually:
|
|
110
80
|
|
|
111
81
|
${loginUrl}
|
|
112
82
|
|
|
113
|
-
`
|
|
114
|
-
);
|
|
83
|
+
`);
|
|
115
84
|
}
|
|
116
85
|
if (process.stdin.isTTY) {
|
|
117
86
|
process.stdout.write(`
|
|
@@ -129,6 +98,40 @@ ${DIM}Or paste a token manually:${RESET}
|
|
|
129
98
|
}
|
|
130
99
|
timeoutId = setTimeout(() => done(null), 5 * 60 * 1e3);
|
|
131
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));
|
|
132
135
|
});
|
|
133
136
|
});
|
|
134
137
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5CTRM3JQ.js";
|
|
5
|
+
import "./chunk-RSA7K5HB.js";
|
|
6
|
+
import "./chunk-PDMWUCWD.js";
|
|
7
|
+
import "./chunk-4VITQVW2.js";
|
|
8
8
|
import "./chunk-TKZLQD2B.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/apis/automation.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5CTRM3JQ.js";
|
|
5
|
+
import "./chunk-RSA7K5HB.js";
|
|
6
|
+
import "./chunk-PDMWUCWD.js";
|
|
7
|
+
import "./chunk-4VITQVW2.js";
|
|
8
8
|
import "./chunk-TKZLQD2B.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/apis/billing.ts
|