@epilot/cli 0.1.20 → 0.1.22

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.20 — CLI for epilot APIs
32
+ epilot v0.1.22 — CLI for epilot APIs
33
33
 
34
34
  USAGE
35
35
  epilot <api> <operationId> [params...] [flags]
@@ -2,12 +2,16 @@
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\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",
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| `document_template` | 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` | design-builder-api.sls.epilot.io | `@epilot/sdk/design` |\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| `access_token` | access-token.sls.epilot.io | `@epilot/sdk/access-token` |\n",
6
6
  "version": "0.2.0"
7
7
  },
8
8
  "servers": [
9
9
  {
10
10
  "url": "https://configuration-hub.sls.epilot.io"
11
+ },
12
+ {
13
+ "url": "https://configuration-hub.dev.sls.epilot.io",
14
+ "description": "Dev"
11
15
  }
12
16
  ],
13
17
  "security": [
@@ -106,6 +110,35 @@
106
110
  "schema": {
107
111
  "type": "string"
108
112
  }
113
+ },
114
+ {
115
+ "name": "blueprint_ids",
116
+ "in": "query",
117
+ "description": "Filter by installed-blueprint IDs (comma-separated). Only configs installed by one of the listed blueprints are returned.",
118
+ "schema": {
119
+ "type": "string"
120
+ }
121
+ },
122
+ {
123
+ "name": "sort",
124
+ "in": "query",
125
+ "description": "Sort order. `updated_at` (default) sorts by most recently modified.\n`usage` sorts by the type-specific usage metric descending\n(submissions for journeys, executions for automations, entities for schemas, etc.).\n",
126
+ "schema": {
127
+ "type": "string",
128
+ "enum": [
129
+ "updated_at",
130
+ "usage"
131
+ ],
132
+ "default": "updated_at"
133
+ }
134
+ },
135
+ {
136
+ "name": "active_only",
137
+ "in": "query",
138
+ "description": "If true, filter out configs that are explicitly inactive (active=false).\nConfigs with no `active` field are always included.\n",
139
+ "schema": {
140
+ "type": "boolean"
141
+ }
109
142
  }
110
143
  ],
111
144
  "responses": {
@@ -178,13 +211,65 @@
178
211
  }
179
212
  }
180
213
  },
181
- "/v1/index/rebuild": {
214
+ "/v1/configs/{type}/{id}/used_by": {
215
+ "get": {
216
+ "operationId": "getConfigUsedBy",
217
+ "summary": "getConfigUsedBy",
218
+ "description": "Get configs that reference the given config (reverse dependencies).\nScans the indexed config items for references to this config's ID or aliases.\n",
219
+ "tags": [
220
+ "Configs"
221
+ ],
222
+ "parameters": [
223
+ {
224
+ "$ref": "#/components/parameters/ConfigType"
225
+ },
226
+ {
227
+ "$ref": "#/components/parameters/ConfigId"
228
+ }
229
+ ],
230
+ "responses": {
231
+ "200": {
232
+ "description": "List of configs that reference this config",
233
+ "content": {
234
+ "application/json": {
235
+ "schema": {
236
+ "$ref": "#/components/schemas/ConfigDependenciesResponse"
237
+ }
238
+ }
239
+ }
240
+ }
241
+ }
242
+ }
243
+ },
244
+ "/v1/configs/index": {
245
+ "get": {
246
+ "operationId": "getIndex",
247
+ "summary": "getIndex",
248
+ "description": "Return the current index build state for the caller's organization.\nClients poll this to decide whether to show a \"building\" indicator\nand when to refetch data.\n",
249
+ "tags": [
250
+ "Configs"
251
+ ],
252
+ "responses": {
253
+ "200": {
254
+ "description": "Current index status",
255
+ "content": {
256
+ "application/json": {
257
+ "schema": {
258
+ "$ref": "#/components/schemas/IndexStatusResponse"
259
+ }
260
+ }
261
+ }
262
+ }
263
+ }
264
+ }
265
+ },
266
+ "/v1/configs/index:rebuild": {
182
267
  "post": {
183
268
  "operationId": "rebuildIndex",
184
269
  "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",
270
+ "description": "Rebuild the configuration index for the caller's organization.\nFire-and-forget: invokes the async worker and returns immediately.\nA new rebuild will cancel any in-flight build (see `build_token`).\n",
186
271
  "tags": [
187
- "Index"
272
+ "Configs"
188
273
  ],
189
274
  "responses": {
190
275
  "200": {
@@ -265,6 +350,7 @@
265
350
  "tax",
266
351
  "coupon",
267
352
  "file",
353
+ "document_template",
268
354
  "webhook",
269
355
  "saved_view",
270
356
  "dashboard",
@@ -283,7 +369,8 @@
283
369
  "entity_mapping",
284
370
  "portal_config",
285
371
  "target",
286
- "product_recommendation"
372
+ "product_recommendation",
373
+ "access_token"
287
374
  ]
288
375
  },
289
376
  "ConfigTypeInfo": {
@@ -353,6 +440,13 @@
353
440
  },
354
441
  "description": "Tags / labels"
355
442
  },
443
+ "aliases": {
444
+ "type": "array",
445
+ "items": {
446
+ "type": "string"
447
+ },
448
+ "description": "Alternative identifiers (short IDs, slugs, variable keys) used in cross-references"
449
+ },
356
450
  "purposes": {
357
451
  "type": "array",
358
452
  "items": {
@@ -364,6 +458,11 @@
364
458
  "type": "string",
365
459
  "format": "uri",
366
460
  "description": "Direct link to open this config in epilot"
461
+ },
462
+ "metadata": {
463
+ "type": "object",
464
+ "description": "Type-specific metadata (e.g., submission count for journeys)",
465
+ "additionalProperties": true
367
466
  }
368
467
  },
369
468
  "required": [
@@ -393,7 +492,7 @@
393
492
  "type": "string",
394
493
  "description": "Cursor for fetching the next page. Absent when no more pages."
395
494
  },
396
- "items": {
495
+ "results": {
397
496
  "type": "array",
398
497
  "items": {
399
498
  "$ref": "#/components/schemas/ConfigNode"
@@ -404,7 +503,7 @@
404
503
  "type",
405
504
  "label",
406
505
  "icon",
407
- "items"
506
+ "results"
408
507
  ]
409
508
  },
410
509
  "ConfigDependenciesResponse": {
@@ -464,6 +563,34 @@
464
563
  "status"
465
564
  ]
466
565
  },
566
+ "IndexStatusResponse": {
567
+ "type": "object",
568
+ "description": "Current index build state",
569
+ "properties": {
570
+ "status": {
571
+ "type": "string",
572
+ "enum": [
573
+ "missing",
574
+ "building",
575
+ "ready",
576
+ "failed"
577
+ ]
578
+ },
579
+ "last_built_at": {
580
+ "type": "string",
581
+ "format": "date-time"
582
+ },
583
+ "total_items": {
584
+ "type": "integer"
585
+ },
586
+ "build_duration_ms": {
587
+ "type": "integer"
588
+ }
589
+ },
590
+ "required": [
591
+ "status"
592
+ ]
593
+ },
467
594
  "ErrorResponse": {
468
595
  "type": "object",
469
596
  "properties": {
@@ -638,6 +638,16 @@
638
638
  }
639
639
  }
640
640
  },
641
+ "409": {
642
+ "description": "Conflict - the workflow was modified by another user since it was last loaded",
643
+ "content": {
644
+ "application/json": {
645
+ "schema": {
646
+ "$ref": "#/components/schemas/ErrorResp"
647
+ }
648
+ }
649
+ }
650
+ },
641
651
  "500": {
642
652
  "description": "Other errors",
643
653
  "content": {
@@ -1795,6 +1805,15 @@
1795
1805
  "type": "string",
1796
1806
  "description": "Id of the automation config that triggers this workflow"
1797
1807
  },
1808
+ "input_entity": {
1809
+ "type": "string",
1810
+ "enum": [
1811
+ "thread",
1812
+ "first_email",
1813
+ "last_email"
1814
+ ],
1815
+ "description": "For email thread triggers, specifies which entity from the triggered email thread to use as the primary input for automation and decision tasks. Defaults to `thread` when not specified.\n"
1816
+ },
1798
1817
  "trigger_config": {
1799
1818
  "type": "array",
1800
1819
  "items": {
@@ -2036,6 +2055,34 @@
2036
2055
  },
2037
2056
  "additionalProperties": true,
2038
2057
  "description": "Transient field. The full automation action configuration following the automation API action schema. Processed by the backend during create/update and stripped before storage. When present without a flow_id, a new automation flow is created. When present with a flow_id, the existing automation flow is updated.\n"
2058
+ },
2059
+ "duplicated_flow_id": {
2060
+ "type": "string",
2061
+ "description": "Transient field. When present, the backend clones the automation flow referenced by this ID and assigns the new flow_id to the task. Used when duplicating an automation task to give it an independent automation. Stripped before storage.\n"
2062
+ },
2063
+ "input_context": {
2064
+ "$ref": "#/components/schemas/AutomationInputContext"
2065
+ }
2066
+ }
2067
+ },
2068
+ "AutomationInputContext": {
2069
+ "type": "object",
2070
+ "description": "Optional. Source of the entity fed into this automation task. If omitted, the workflow's primary entity is used.\n",
2071
+ "required": [
2072
+ "source"
2073
+ ],
2074
+ "properties": {
2075
+ "source": {
2076
+ "type": "string",
2077
+ "enum": [
2078
+ "trigger",
2079
+ "task"
2080
+ ],
2081
+ "description": "`trigger` = workflow's primary (trigger) entity. `task` = entity produced by an upstream task in the graph.\n"
2082
+ },
2083
+ "task_id": {
2084
+ "type": "string",
2085
+ "description": "Required when source is `task`. The id of the upstream task whose output entity should feed this task."
2039
2086
  }
2040
2087
  }
2041
2088
  },
@@ -2196,6 +2243,11 @@
2196
2243
  "$ref": "#/components/schemas/Condition"
2197
2244
  }
2198
2245
  },
2246
+ "allow_parallel_execution": {
2247
+ "type": "boolean",
2248
+ "description": "When true, all branches with met conditions execute in parallel. When false, only the first branch with a met condition is executed. Defaults to true for backwards compatibility.",
2249
+ "default": true
2250
+ },
2199
2251
  "schedule": {
2200
2252
  "anyOf": [
2201
2253
  {
@@ -3764,12 +3764,36 @@
3764
3764
  },
3765
3765
  "error_reason": {
3766
3766
  "type": "string"
3767
+ },
3768
+ "input_context": {
3769
+ "$ref": "#/components/schemas/AutomationInputContext"
3767
3770
  }
3768
3771
  },
3769
3772
  "required": [
3770
3773
  "flow_id"
3771
3774
  ]
3772
3775
  },
3776
+ "AutomationInputContext": {
3777
+ "type": "object",
3778
+ "description": "Optional. Source of the entity fed into this automation task. If omitted, the workflow's primary entity is used.\n",
3779
+ "required": [
3780
+ "source"
3781
+ ],
3782
+ "properties": {
3783
+ "source": {
3784
+ "type": "string",
3785
+ "enum": [
3786
+ "trigger",
3787
+ "task"
3788
+ ],
3789
+ "description": "`trigger` = workflow's primary (trigger) entity. `task` = entity produced by an upstream task in the graph.\n"
3790
+ },
3791
+ "task_id": {
3792
+ "type": "string",
3793
+ "description": "Required when source is `task`. The id of the upstream task whose output entity should feed this task."
3794
+ }
3795
+ }
3796
+ },
3773
3797
  "AnalyticsInfo": {
3774
3798
  "type": "object",
3775
3799
  "properties": {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  API_LIST
4
- } from "../chunk-JFIDAAH4.js";
4
+ } from "../chunk-KI2MVPE4.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.20",
14
+ version: "0.1.22",
15
15
  description: "CLI for epilot APIs"
16
16
  },
17
17
  args: {
@@ -30,8 +30,8 @@ var main = defineCommand({
30
30
  auth: () => import("../auth-CN5EFFDE.js").then((m) => m.default),
31
31
  profile: () => import("../profile-OZJL5ZPT.js").then((m) => m.default),
32
32
  config: () => import("../config-DGZIMLZK.js").then((m) => m.default),
33
- completion: () => import("../completion-INJETNZK.js").then((m) => m.default),
34
- upgrade: () => import("../upgrade-EAQWUJZS.js").then((m) => m.default),
33
+ completion: () => import("../completion-A3BQFVLK.js").then((m) => m.default),
34
+ upgrade: () => import("../upgrade-XAY377R6.js").then((m) => m.default),
35
35
  "access-token": () => import("../access-token-WWE6BDJH.js").then((m) => m.default),
36
36
  address: () => import("../address-EH3C4CVB.js").then((m) => m.default),
37
37
  "address-suggestions": () => import("../address-suggestions-RRSLOBFW.js").then((m) => m.default),
@@ -84,6 +84,45 @@ var main = defineCommand({
84
84
  }
85
85
  });
86
86
 
87
+ // src/lib/reorder-args.ts
88
+ var VALUE_TAKING_FLAGS = /* @__PURE__ */ new Set([
89
+ // long
90
+ "--token",
91
+ "--profile",
92
+ "--server",
93
+ "--jsonata",
94
+ "--definition",
95
+ // short
96
+ "-t",
97
+ "-s"
98
+ ]);
99
+ var isFlag = (token) => {
100
+ if (token === "-" || token === "--") return false;
101
+ return token.startsWith("-");
102
+ };
103
+ var consumesNextToken = (token) => {
104
+ if (token.includes("=")) return false;
105
+ return VALUE_TAKING_FLAGS.has(token);
106
+ };
107
+ var hoistFlagsAfterSubcommand = (argv) => {
108
+ let firstPositionalIdx = -1;
109
+ for (let i = 0; i < argv.length; i++) {
110
+ const token = argv[i];
111
+ if (isFlag(token)) {
112
+ if (consumesNextToken(token)) i += 1;
113
+ continue;
114
+ }
115
+ if (token === "--") break;
116
+ firstPositionalIdx = i;
117
+ break;
118
+ }
119
+ if (firstPositionalIdx <= 0) return argv.slice();
120
+ const leading = argv.slice(0, firstPositionalIdx);
121
+ const subcommand = argv[firstPositionalIdx];
122
+ const rest = argv.slice(firstPositionalIdx + 1);
123
+ return [subcommand, ...rest, ...leading];
124
+ };
125
+
87
126
  // bin/epilot.ts
88
127
  process.stdout.on("error", (err) => {
89
128
  if (err.code === "EPIPE") process.exit(0);
@@ -93,11 +132,13 @@ process.stderr.on("error", (err) => {
93
132
  if (err.code === "EPIPE") process.exit(0);
94
133
  throw err;
95
134
  });
96
- var VERSION = true ? "0.1.20" : (await null).default.version;
135
+ var VERSION = true ? "0.1.22" : (await null).default.version;
136
+ var reorderedArgv = hoistFlagsAfterSubcommand(process.argv.slice(2));
137
+ process.argv = [process.argv[0], process.argv[1], ...reorderedArgv];
97
138
  var args = process.argv.slice(2);
98
139
  var completionsIdx = args.indexOf("--_completions");
99
140
  if (completionsIdx >= 0) {
100
- const { handleCompletions } = await import("../completion-INJETNZK.js");
141
+ const { handleCompletions } = await import("../completion-A3BQFVLK.js");
101
142
  handleCompletions(args[completionsIdx + 1], args[completionsIdx + 2]);
102
143
  process.exit(0);
103
144
  }
@@ -208,8 +208,15 @@ var API_LIST = [
208
208
  kebabName: "configuration-hub",
209
209
  title: "Configuration Hub API",
210
210
  serverUrl: "https://configuration-hub.sls.epilot.io",
211
- operationCount: 4,
212
- operationIds: ["listConfigTypes", "listConfigs", "getConfigDependencies", "rebuildIndex"]
211
+ operationCount: 6,
212
+ operationIds: [
213
+ "listConfigTypes",
214
+ "listConfigs",
215
+ "getConfigDependencies",
216
+ "getConfigUsedBy",
217
+ "getIndex",
218
+ "rebuildIndex"
219
+ ]
213
220
  },
214
221
  {
215
222
  apiName: "consent",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  API_LIST
4
- } from "./chunk-JFIDAAH4.js";
4
+ } from "./chunk-KI2MVPE4.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.20";
75
+ if (true) return "0.1.22";
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.20",
3
+ "version": "0.1.22",
4
4
  "description": "CLI for epilot APIs",
5
5
  "type": "module",
6
6
  "bin": {