@epilot/cli 0.1.17 → 0.1.19

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 CHANGED
@@ -29,7 +29,7 @@ npm install -g @epilot/cli
29
29
 
30
30
  <!-- usage-help -->
31
31
  ```
32
- epilot v0.1.17 — CLI for epilot APIs
32
+ epilot v0.1.19 — CLI for epilot APIs
33
33
 
34
34
  USAGE
35
35
  epilot <api> <operationId> [params...] [flags]
@@ -2,17 +2,12 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "Configuration Hub API",
5
- "description": "Lightweight index API for exploring epilot organization configurations.\n\nProvides a unified tree view across all config types. Returns summary metadata only —\nthe frontend calls individual epilot APIs directly (via @epilot/sdk) for full config payloads.\n",
5
+ "description": "Lightweight index API for exploring epilot organization configurations.\n\nProvides a unified tree view across all config types. Returns summary metadata only —\nthe frontend calls individual epilot APIs directly (via @epilot/sdk) for full config payloads.\n\n## Source APIs per resource type\n\nEach resource type maps to a specific epilot API. The frontend should use the corresponding\n@epilot/sdk client to fetch full config details (e.g., for the side panel JSON view).\n\n| Resource Type | Source API | SDK Client |\n|---|---|---|\n| `journey` | journey.sls.epilot.io | `@epilot/sdk/journey` |\n| `automation_flow` | automation.sls.epilot.io | `@epilot/sdk/automation` |\n| `workflow_definition` | workflow-definition.sls.epilot.io | `@epilot/sdk/workflow-definition` |\n| `closing_reason` | workflow-definition.sls.epilot.io | `@epilot/sdk/workflow-definition` |\n| `flow_template` | workflow-definition.sls.epilot.io | `@epilot/sdk/workflow-definition` |\n| `schema` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `taxonomy` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `taxonomy_classification` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `emailtemplate` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `product` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `price` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `tax` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `coupon` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `file` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `webhook` | webhooks.sls.epilot.io | `@epilot/sdk/webhooks` |\n| `saved_view` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `dashboard` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `kanban` | kanban.sls.epilot.io | `@epilot/sdk/kanban` |\n| `role` | permissions.sls.epilot.io | `@epilot/sdk/permissions` |\n| `usergroup` | user.sls.epilot.io | `@epilot/sdk/user` |\n| `validation_rule` | entity.sls.epilot.io | `@epilot/sdk/validation-rules` |\n| `integration` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `app` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `designbuilder` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `notification_template` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `custom_variable` | entity.sls.epilot.io | `@epilot/sdk/template-variables` |\n| `environment_variable` | environments.sls.epilot.io | `@epilot/sdk/environments` |\n| `entity_mapping` | entity-mapping.sls.epilot.io | `@epilot/sdk/entity-mapping` |\n| `portal_config` | customer-portal.sls.epilot.io | `@epilot/sdk/customer-portal` |\n| `target` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n| `product_recommendation` | entity.sls.epilot.io | `@epilot/sdk/entity` |\n",
6
6
  "version": "0.2.0"
7
7
  },
8
8
  "servers": [
9
9
  {
10
- "url": "https://configuration-hub.dev.sls.epilot.io",
11
- "description": "Dev"
12
- },
13
- {
14
- "url": "https://configuration-hub.sls.epilot.io",
15
- "description": "Production"
10
+ "url": "https://configuration-hub.sls.epilot.io"
16
11
  }
17
12
  ],
18
13
  "security": [
@@ -77,6 +72,40 @@
77
72
  },
78
73
  {
79
74
  "$ref": "#/components/parameters/SizeParam"
75
+ },
76
+ {
77
+ "name": "q",
78
+ "in": "query",
79
+ "description": "Search query to filter configs by name/title",
80
+ "schema": {
81
+ "type": "string"
82
+ }
83
+ },
84
+ {
85
+ "name": "updated_after",
86
+ "in": "query",
87
+ "description": "Filter configs updated after this date (ISO 8601)",
88
+ "schema": {
89
+ "type": "string",
90
+ "format": "date-time"
91
+ }
92
+ },
93
+ {
94
+ "name": "updated_before",
95
+ "in": "query",
96
+ "description": "Filter configs updated before this date (ISO 8601)",
97
+ "schema": {
98
+ "type": "string",
99
+ "format": "date-time"
100
+ }
101
+ },
102
+ {
103
+ "name": "purposes",
104
+ "in": "query",
105
+ "description": "Filter by purpose classification IDs (comma-separated)",
106
+ "schema": {
107
+ "type": "string"
108
+ }
80
109
  }
81
110
  ],
82
111
  "responses": {
@@ -148,6 +177,28 @@
148
177
  }
149
178
  }
150
179
  }
180
+ },
181
+ "/v1/index/rebuild": {
182
+ "post": {
183
+ "operationId": "rebuildIndex",
184
+ "summary": "rebuildIndex",
185
+ "description": "Rebuild the configuration index for the caller's organization.\nCalls all adapter APIs in parallel and stores results in DynamoDB.\nIf a build is already in progress (within 60s), returns immediately.\n",
186
+ "tags": [
187
+ "Index"
188
+ ],
189
+ "responses": {
190
+ "200": {
191
+ "description": "Index build status",
192
+ "content": {
193
+ "application/json": {
194
+ "schema": {
195
+ "$ref": "#/components/schemas/IndexRebuildResponse"
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
151
202
  }
152
203
  },
153
204
  "components": {
@@ -379,6 +430,40 @@
379
430
  "results"
380
431
  ]
381
432
  },
433
+ "IndexRebuildResponse": {
434
+ "type": "object",
435
+ "description": "Result of an index rebuild operation",
436
+ "properties": {
437
+ "status": {
438
+ "type": "string",
439
+ "enum": [
440
+ "ready",
441
+ "building",
442
+ "failed",
443
+ "already_building"
444
+ ]
445
+ },
446
+ "last_built_at": {
447
+ "type": "string",
448
+ "format": "date-time"
449
+ },
450
+ "total_items": {
451
+ "type": "integer"
452
+ },
453
+ "build_duration_ms": {
454
+ "type": "integer"
455
+ },
456
+ "failed_types": {
457
+ "type": "array",
458
+ "items": {
459
+ "type": "string"
460
+ }
461
+ }
462
+ },
463
+ "required": [
464
+ "status"
465
+ ]
466
+ },
382
467
  "ErrorResponse": {
383
468
  "type": "object",
384
469
  "properties": {
@@ -21,7 +21,7 @@ var auth_default = defineCommand({
21
21
  description: "Manage authentication"
22
22
  },
23
23
  subCommands: {
24
- login: () => import("./auth-login-AJ6F5GPQ.js").then((m) => m.default),
24
+ login: () => import("./auth-login-X2GRQW6N.js").then((m) => m.default),
25
25
  token: () => import("./auth-token-J4FI2RMT.js").then((m) => m.default),
26
26
  logout: defineCommand({
27
27
  meta: { name: "logout", description: "Remove stored credentials" },
@@ -17,14 +17,34 @@ import {
17
17
  import { defineCommand } from "citty";
18
18
  import { randomBytes } from "crypto";
19
19
  import { createServer } from "http";
20
+
21
+ // src/lib/environment.ts
22
+ var PORTAL_URLS = {
23
+ production: "https://portal.epilot.cloud",
24
+ staging: "https://portal.staging.epilot.cloud",
25
+ dev: "https://portal.dev.epilot.cloud"
26
+ };
27
+ var getPortalUrl = (env = "production") => {
28
+ return PORTAL_URLS[env];
29
+ };
30
+ var resolveEnvironment = (useDev, useStaging) => {
31
+ if (useDev) return "dev";
32
+ if (useStaging) return "staging";
33
+ return "production";
34
+ };
35
+
36
+ // src/commands/auth-login.ts
20
37
  var auth_login_default = defineCommand({
21
38
  meta: { name: "login", description: "Authenticate with epilot" },
22
39
  args: {
23
40
  token: { type: "string", description: "Manually provide a token instead of browser login" },
24
- profile: { type: "string", description: "Save credentials to this profile" }
41
+ profile: { type: "string", description: "Save credentials to this profile" },
42
+ "use-dev": { type: "boolean", description: "Use dev environment (portal.dev.epilot.cloud)" },
43
+ "use-staging": { type: "boolean", description: "Use staging environment (portal.staging.epilot.cloud)" }
25
44
  },
26
45
  run: async ({ args }) => {
27
46
  const profileName = args.profile || process.env.EPILOT_PROFILE;
47
+ const env = resolveEnvironment(args["use-dev"], args["use-staging"]);
28
48
  if (args.token) {
29
49
  saveCredentials({ token: args.token }, profileName);
30
50
  const suffix = profileName ? ` to profile "${profileName}"` : "";
@@ -41,7 +61,7 @@ var auth_login_default = defineCommand({
41
61
  );
42
62
  process.exit(1);
43
63
  }
44
- const token = await browserLogin(profileName);
64
+ const token = await browserLogin(profileName, env);
45
65
  if (token) {
46
66
  process.stdout.write(`${GREEN}${BOLD}Login successful!${RESET}
47
67
  `);
@@ -52,7 +72,7 @@ var auth_login_default = defineCommand({
52
72
  }
53
73
  }
54
74
  });
55
- var browserLogin = async (profileName) => {
75
+ var browserLogin = async (profileName, env = "production") => {
56
76
  const state = randomBytes(32).toString("hex");
57
77
  const verificationCode = randomBytes(3).toString("hex").toUpperCase();
58
78
  const suffix = profileName ? ` ${DIM}(profile: ${profileName})${RESET}` : "";
@@ -96,7 +116,8 @@ ${BOLD}epilot CLI Login${RESET}${suffix}
96
116
  }
97
117
  const port = address.port;
98
118
  const callbackUrl = `http://localhost:${port}/callback`;
99
- const loginUrl = `https://portal.epilot.cloud/login?cli_callback=${encodeURIComponent(callbackUrl)}&state=${state}&code=${verificationCode}`;
119
+ const portalUrl = getPortalUrl(env);
120
+ const loginUrl = `${portalUrl}/login?cli_callback=${encodeURIComponent(callbackUrl)}&state=${state}&code=${verificationCode}`;
100
121
  process.stdout.write(`
101
122
  ${DIM}Login URL: ${loginUrl}${RESET}
102
123
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  API_LIST
4
- } from "../chunk-XQLUS2BD.js";
4
+ } from "../chunk-JFIDAAH4.js";
5
5
 
6
6
  // bin/epilot.ts
7
7
  import { runMain } from "citty";
@@ -11,7 +11,7 @@ import { defineCommand } from "citty";
11
11
  var main = defineCommand({
12
12
  meta: {
13
13
  name: "epilot",
14
- version: "0.1.17",
14
+ version: "0.1.19",
15
15
  description: "CLI for epilot APIs"
16
16
  },
17
17
  args: {
@@ -25,10 +25,10 @@ var main = defineCommand({
25
25
  jsonata: { type: "string", description: "JSONata expression" }
26
26
  },
27
27
  subCommands: {
28
- auth: () => import("../auth-AAF6Z5WZ.js").then((m) => m.default),
28
+ auth: () => import("../auth-OPYS3QFL.js").then((m) => m.default),
29
29
  profile: () => import("../profile-EK4HSQ57.js").then((m) => m.default),
30
- completion: () => import("../completion-KA3HJ6PR.js").then((m) => m.default),
31
- upgrade: () => import("../upgrade-RQP5SN7U.js").then((m) => m.default),
30
+ completion: () => import("../completion-INJETNZK.js").then((m) => m.default),
31
+ upgrade: () => import("../upgrade-BFBIJHFI.js").then((m) => m.default),
32
32
  "access-token": () => import("../access-token-CIM4RLBP.js").then((m) => m.default),
33
33
  address: () => import("../address-EDRTUWTP.js").then((m) => m.default),
34
34
  "address-suggestions": () => import("../address-suggestions-S5WEST2N.js").then((m) => m.default),
@@ -90,11 +90,11 @@ process.stderr.on("error", (err) => {
90
90
  if (err.code === "EPIPE") process.exit(0);
91
91
  throw err;
92
92
  });
93
- var VERSION = true ? "0.1.17" : (await null).default.version;
93
+ var VERSION = true ? "0.1.19" : (await null).default.version;
94
94
  var args = process.argv.slice(2);
95
95
  var completionsIdx = args.indexOf("--_completions");
96
96
  if (completionsIdx >= 0) {
97
- const { handleCompletions } = await import("../completion-KA3HJ6PR.js");
97
+ const { handleCompletions } = await import("../completion-INJETNZK.js");
98
98
  handleCompletions(args[completionsIdx + 1], args[completionsIdx + 2]);
99
99
  process.exit(0);
100
100
  }
@@ -207,9 +207,9 @@ var API_LIST = [
207
207
  apiName: "configurationHub",
208
208
  kebabName: "configuration-hub",
209
209
  title: "Configuration Hub API",
210
- serverUrl: "https://configuration-hub.dev.sls.epilot.io",
211
- operationCount: 3,
212
- operationIds: ["listConfigTypes", "listConfigs", "getConfigDependencies"]
210
+ serverUrl: "https://configuration-hub.sls.epilot.io",
211
+ operationCount: 4,
212
+ operationIds: ["listConfigTypes", "listConfigs", "getConfigDependencies", "rebuildIndex"]
213
213
  },
214
214
  {
215
215
  apiName: "consent",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  API_LIST
4
- } from "./chunk-XQLUS2BD.js";
4
+ } from "./chunk-JFIDAAH4.js";
5
5
  import {
6
6
  DIM,
7
7
  GREEN,
@@ -72,7 +72,7 @@ ${GREEN}${BOLD}Upgraded to @epilot/cli@${latest}${RESET}
72
72
  }
73
73
  });
74
74
  var getCurrentVersion = () => {
75
- if (true) return "0.1.17";
75
+ if (true) return "0.1.19";
76
76
  try {
77
77
  const output = execSync("npm ls -g @epilot/cli --depth=0 --json 2>/dev/null", {
78
78
  encoding: "utf-8",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/cli",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "CLI for epilot APIs",
5
5
  "type": "module",
6
6
  "bin": {