@getfrontline/cli 1.0.3 → 1.0.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 (145) hide show
  1. package/README.md +173 -7
  2. package/dist/commands/agents/builder.d.ts +10 -0
  3. package/dist/commands/agents/builder.d.ts.map +1 -0
  4. package/dist/commands/agents/builder.js +243 -0
  5. package/dist/commands/agents/builder.js.map +1 -0
  6. package/dist/commands/agents/flows.d.ts.map +1 -1
  7. package/dist/commands/agents/flows.js +253 -25
  8. package/dist/commands/agents/flows.js.map +1 -1
  9. package/dist/commands/agents/intents.d.ts +3 -0
  10. package/dist/commands/agents/intents.d.ts.map +1 -0
  11. package/dist/commands/agents/intents.js +137 -0
  12. package/dist/commands/agents/intents.js.map +1 -0
  13. package/dist/commands/agents/use.d.ts +3 -0
  14. package/dist/commands/agents/use.d.ts.map +1 -0
  15. package/dist/commands/agents/use.js +33 -0
  16. package/dist/commands/agents/use.js.map +1 -0
  17. package/dist/commands/agents/variables.d.ts +3 -0
  18. package/dist/commands/agents/variables.d.ts.map +1 -0
  19. package/dist/commands/agents/variables.js +111 -0
  20. package/dist/commands/agents/variables.js.map +1 -0
  21. package/dist/commands/aiModels/index.d.ts +3 -0
  22. package/dist/commands/aiModels/index.d.ts.map +1 -0
  23. package/dist/commands/aiModels/index.js +60 -0
  24. package/dist/commands/aiModels/index.js.map +1 -0
  25. package/dist/commands/incomingWebhooks/index.d.ts +3 -0
  26. package/dist/commands/incomingWebhooks/index.d.ts.map +1 -0
  27. package/dist/commands/incomingWebhooks/index.js +28 -0
  28. package/dist/commands/incomingWebhooks/index.js.map +1 -0
  29. package/dist/commands/object/activity.d.ts +3 -0
  30. package/dist/commands/object/activity.d.ts.map +1 -0
  31. package/dist/commands/object/{note.js → activity.js} +24 -19
  32. package/dist/commands/object/activity.js.map +1 -0
  33. package/dist/commands/object/export.js +3 -3
  34. package/dist/commands/object/field.js +5 -5
  35. package/dist/commands/object/index.js +10 -10
  36. package/dist/commands/object/index.js.map +1 -1
  37. package/dist/commands/object/option.js +4 -4
  38. package/dist/commands/object/record-type.js +4 -4
  39. package/dist/commands/object/record.js +8 -8
  40. package/dist/commands/object/relation.js +4 -4
  41. package/dist/commands/object/view.js +9 -9
  42. package/dist/commands/table/index.d.ts.map +1 -1
  43. package/dist/commands/table/index.js +0 -4
  44. package/dist/commands/table/index.js.map +1 -1
  45. package/dist/commands/tools/index.d.ts +3 -0
  46. package/dist/commands/tools/index.d.ts.map +1 -0
  47. package/dist/commands/tools/index.js +113 -0
  48. package/dist/commands/tools/index.js.map +1 -0
  49. package/dist/commands/util/uuid.d.ts +3 -0
  50. package/dist/commands/util/uuid.d.ts.map +1 -0
  51. package/dist/commands/util/uuid.js +15 -0
  52. package/dist/commands/util/uuid.js.map +1 -0
  53. package/dist/commands/workflows/analytics.d.ts.map +1 -1
  54. package/dist/commands/workflows/analytics.js +9 -3
  55. package/dist/commands/workflows/analytics.js.map +1 -1
  56. package/dist/commands/workflows/common.d.ts +39 -0
  57. package/dist/commands/workflows/common.d.ts.map +1 -0
  58. package/dist/commands/workflows/common.js +45 -0
  59. package/dist/commands/workflows/common.js.map +1 -0
  60. package/dist/commands/workflows/create.d.ts +3 -0
  61. package/dist/commands/workflows/create.d.ts.map +1 -0
  62. package/dist/commands/workflows/create.js +41 -0
  63. package/dist/commands/workflows/create.js.map +1 -0
  64. package/dist/commands/workflows/delete.d.ts +3 -0
  65. package/dist/commands/workflows/delete.d.ts.map +1 -0
  66. package/dist/commands/workflows/delete.js +20 -0
  67. package/dist/commands/workflows/delete.js.map +1 -0
  68. package/dist/commands/workflows/describe.d.ts +3 -0
  69. package/dist/commands/workflows/describe.d.ts.map +1 -0
  70. package/dist/commands/workflows/describe.js +40 -0
  71. package/dist/commands/workflows/describe.js.map +1 -0
  72. package/dist/commands/workflows/edges.d.ts +3 -0
  73. package/dist/commands/workflows/edges.d.ts.map +1 -0
  74. package/dist/commands/workflows/edges.js +50 -0
  75. package/dist/commands/workflows/edges.js.map +1 -0
  76. package/dist/commands/workflows/graph.d.ts +3 -0
  77. package/dist/commands/workflows/graph.d.ts.map +1 -0
  78. package/dist/commands/workflows/graph.js +47 -0
  79. package/dist/commands/workflows/graph.js.map +1 -0
  80. package/dist/commands/workflows/nodes.d.ts +3 -0
  81. package/dist/commands/workflows/nodes.d.ts.map +1 -0
  82. package/dist/commands/workflows/nodes.js +68 -0
  83. package/dist/commands/workflows/nodes.js.map +1 -0
  84. package/dist/commands/workflows/update.d.ts +3 -0
  85. package/dist/commands/workflows/update.d.ts.map +1 -0
  86. package/dist/commands/workflows/update.js +42 -0
  87. package/dist/commands/workflows/update.js.map +1 -0
  88. package/dist/commands/workflows/use.d.ts +3 -0
  89. package/dist/commands/workflows/use.d.ts.map +1 -0
  90. package/dist/commands/workflows/use.js +34 -0
  91. package/dist/commands/workflows/use.js.map +1 -0
  92. package/dist/commands/workflows/variables.d.ts +3 -0
  93. package/dist/commands/workflows/variables.d.ts.map +1 -0
  94. package/dist/commands/workflows/variables.js +105 -0
  95. package/dist/commands/workflows/variables.js.map +1 -0
  96. package/dist/index.js +50 -1
  97. package/dist/index.js.map +1 -1
  98. package/dist/lib/config.d.ts +9 -0
  99. package/dist/lib/config.d.ts.map +1 -1
  100. package/dist/lib/config.js +54 -0
  101. package/dist/lib/config.js.map +1 -1
  102. package/dist/lib/httpClient.d.ts +2 -1
  103. package/dist/lib/httpClient.d.ts.map +1 -1
  104. package/dist/lib/httpClient.js +5 -2
  105. package/dist/lib/httpClient.js.map +1 -1
  106. package/dist/max/ui/banner.js +15 -15
  107. package/dist/max.js +7 -1
  108. package/dist/max.js.map +1 -1
  109. package/dist/scripts/postinstall.d.ts.map +1 -1
  110. package/dist/scripts/postinstall.js +8 -0
  111. package/dist/scripts/postinstall.js.map +1 -1
  112. package/dist/skills/agent-builder/SKILL.md +88 -0
  113. package/dist/skills/aggregations/SKILL.md +7 -7
  114. package/dist/skills/ai-models/SKILL.md +43 -0
  115. package/dist/skills/auth-and-profiles/SKILL.md +1 -1
  116. package/dist/skills/crm-setup/SKILL.md +66 -48
  117. package/dist/skills/crud-operations/SKILL.md +2 -2
  118. package/dist/skills/export-and-delete/SKILL.md +5 -5
  119. package/dist/skills/files/SKILL.md +4 -4
  120. package/dist/skills/filter-and-query/SKILL.md +7 -7
  121. package/dist/skills/flow-builder/SKILL.md +124 -0
  122. package/dist/skills/frontline-agents/SKILL.md +152 -3
  123. package/dist/skills/frontline-internals/SKILL.md +7 -7
  124. package/dist/skills/frontline-workflows/SKILL.md +170 -3
  125. package/dist/skills/incoming-webhooks/SKILL.md +36 -0
  126. package/dist/skills/notes-and-tasks/SKILL.md +29 -29
  127. package/dist/skills/pipeline-setup/SKILL.md +13 -13
  128. package/dist/skills/relations/SKILL.md +15 -15
  129. package/dist/skills/resource-creation/SKILL.md +70 -1
  130. package/dist/skills/schema-design/SKILL.md +21 -14
  131. package/dist/skills/tools/SKILL.md +65 -0
  132. package/dist/skills/variables/SKILL.md +82 -0
  133. package/dist/skills/workflow-builder/SKILL.md +426 -0
  134. package/package.json +51 -51
  135. package/dist/commands/object/note.d.ts +0 -3
  136. package/dist/commands/object/note.d.ts.map +0 -1
  137. package/dist/commands/object/note.js.map +0 -1
  138. package/dist/commands/table/note.d.ts +0 -3
  139. package/dist/commands/table/note.d.ts.map +0 -1
  140. package/dist/commands/table/note.js +0 -62
  141. package/dist/commands/table/note.js.map +0 -1
  142. package/dist/commands/table/task.d.ts +0 -3
  143. package/dist/commands/table/task.d.ts.map +0 -1
  144. package/dist/commands/table/task.js +0 -88
  145. package/dist/commands/table/task.js.map +0 -1
@@ -16,9 +16,9 @@ const listCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("list")
16
16
  .option("--record-type <name>", "Filter by record type")
17
17
  .addHelpText("after", `
18
18
  Examples:
19
- $ frontline object record list standard__people
20
- $ frontline object record list standard__deals --search "acme"
21
- $ frontline object record list standard__deals --record-type lead --page-size 20
19
+ $ frontline object record list people
20
+ $ frontline object record list deals --search "acme"
21
+ $ frontline object record list deals --record-type lead --page-size 20
22
22
 
23
23
  Output: { rows: [...], total_count, total_pages, current_page }`)).action(async (objectName, opts) => {
24
24
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -44,7 +44,7 @@ const getCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("get")
44
44
  .argument("<id>", "Record ID (MongoDB ObjectId)")
45
45
  .addHelpText("after", `
46
46
  Examples:
47
- $ frontline object record get standard__people 6625abc123def456
47
+ $ frontline object record get people 6625abc123def456
48
48
 
49
49
  Output: Single record with id, auto_id, created_at, updated_at, and all field values.`)).action(async (objectName, id, opts) => {
50
50
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -57,7 +57,7 @@ const createCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("create")
57
57
  .option("--data <json>", "Record field values (JSON)")
58
58
  .addHelpText("after", `
59
59
  Examples:
60
- $ frontline object record create standard__people --data '{"First Name":"John","Last Name":"Doe","Email":"john@example.com"}'
60
+ $ frontline object record create people --data '{"First Name":"John","Last Name":"Doe","Email":"john@example.com"}'
61
61
 
62
62
  Output: Created record object.`)).action(async (objectName, opts) => {
63
63
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -75,7 +75,7 @@ const updateCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("update")
75
75
  .option("--data <json>", "Updated field values (JSON)")
76
76
  .addHelpText("after", `
77
77
  Examples:
78
- $ frontline object record update standard__people 6625abc123def456 --data '{"Email":"new@example.com"}'
78
+ $ frontline object record update people 6625abc123def456 --data '{"Email":"new@example.com"}'
79
79
 
80
80
  Output: Updated record object.`)).action(async (objectName, id, opts) => {
81
81
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -92,7 +92,7 @@ const deleteCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("delete")
92
92
  .argument("<id>", "Record ID (MongoDB ObjectId)")
93
93
  .addHelpText("after", `
94
94
  Examples:
95
- $ frontline object record delete standard__people 6625abc123def456
95
+ $ frontline object record delete people 6625abc123def456
96
96
 
97
97
  Output: { deleted: true, row_id: "6625abc123def456" }`)).action(async (objectName, id, opts) => {
98
98
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -105,7 +105,7 @@ const bulkCreateCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("bulk
105
105
  .option("--data <json>", "Array of record field values (JSON)")
106
106
  .addHelpText("after", `
107
107
  Examples:
108
- $ frontline object record bulk-create standard__people --data '[{"First Name":"John","Last Name":"Doe"},{"First Name":"Jane","Last Name":"Smith"}]'
108
+ $ frontline object record bulk-create people --data '[{"First Name":"John","Last Name":"Doe"},{"First Name":"Jane","Last Name":"Smith"}]'
109
109
 
110
110
  Output: Array of created record objects.`)).action(async (objectName, opts) => {
111
111
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -11,7 +11,7 @@ const getCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("get")
11
11
  .argument("<relation>", "Relation name (e.g. company, people)")
12
12
  .addHelpText("after", `
13
13
  Examples:
14
- $ frontline object relation get standard__people 6625abc123def456 company
14
+ $ frontline object relation get people 6625abc123def456 company
15
15
 
16
16
  Output: Array of related records.`)).action(async (objectName, id, relation, opts) => {
17
17
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -27,7 +27,7 @@ const findByCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("find-by"
27
27
  .option("--page-size <n>", "Rows per page", "50")
28
28
  .addHelpText("after", `
29
29
  Examples:
30
- $ frontline object relation find-by standard__people company 6625abc123def456
30
+ $ frontline object relation find-by people company 6625abc123def456
31
31
 
32
32
  Output: { rows: [...], total_count, total_pages, current_page }`)).action(async (objectName, relation, targetId, opts) => {
33
33
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -42,7 +42,7 @@ const linkCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("link")
42
42
  .argument("<target-id>", "Target record ID to link")
43
43
  .addHelpText("after", `
44
44
  Examples:
45
- $ frontline object relation link standard__people 6625abc123def456 company 6625def789abc012
45
+ $ frontline object relation link people 6625abc123def456 company 6625def789abc012
46
46
 
47
47
  Output: Updated source record.`)).action(async (objectName, id, relation, targetId, opts) => {
48
48
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -57,7 +57,7 @@ const unlinkCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("unlink")
57
57
  .argument("<target-id>", "Target record ID to unlink")
58
58
  .addHelpText("after", `
59
59
  Examples:
60
- $ frontline object relation unlink standard__people 6625abc123def456 company 6625def789abc012
60
+ $ frontline object relation unlink people 6625abc123def456 company 6625def789abc012
61
61
 
62
62
  Output: Updated source record.`)).action(async (objectName, id, relation, targetId, opts) => {
63
63
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -9,7 +9,7 @@ const listCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("list")
9
9
  .argument("<object>", "Object name (slug)")
10
10
  .addHelpText("after", `
11
11
  Examples:
12
- $ frontline object view list standard__people
12
+ $ frontline object view list people
13
13
 
14
14
  Output: Array of views with id, name, type, is_default, is_private.`)).action(async (objectName, opts) => {
15
15
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -23,8 +23,8 @@ const createCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("create")
23
23
  .option("--record-type <id>", "Record type ID (uses default if omitted)")
24
24
  .addHelpText("after", `
25
25
  Examples:
26
- $ frontline object view create standard__deals --data '{"name":"Kanban","type":"KANBAN","metadata":{"groupingColumnId":42}}'
27
- $ frontline object view create standard__deals --record-type 10 --data '{"name":"Board","type":"TABLE","metadata":{}}'
26
+ $ frontline object view create deals --data '{"name":"Kanban","type":"KANBAN","metadata":{"groupingColumnId":42}}'
27
+ $ frontline object view create deals --record-type 10 --data '{"name":"Board","type":"TABLE","metadata":{}}'
28
28
 
29
29
  View types: TABLE, KANBAN, RECORD
30
30
 
@@ -54,11 +54,11 @@ const updateCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("update")
54
54
  .option("--data <json>", "Other updated view data (JSON)")
55
55
  .addHelpText("after", `
56
56
  Examples:
57
- $ frontline object view update standard__deals 12 --name "My Deals" --column-order "Name, Stage, Amount"
58
- $ frontline object view update standard__deals 12 --hidden-columns "Created At, Updated At"
59
- $ frontline object view update standard__deals 12 --dialog-field-order "Name, Stage, Close Date"
60
- $ frontline object view update standard__deals 12 --sticky-columns "Name, Stage"
61
- $ frontline object view update standard__deals 12 --option-order "Closed, Won, In Progress, Lead"
57
+ $ frontline object view update deals 12 --name "My Deals" --column-order "Name, Stage, Amount"
58
+ $ frontline object view update deals 12 --hidden-columns "Created At, Updated At"
59
+ $ frontline object view update deals 12 --dialog-field-order "Name, Stage, Close Date"
60
+ $ frontline object view update deals 12 --sticky-columns "Name, Stage"
61
+ $ frontline object view update deals 12 --option-order "Closed, Won, In Progress, Lead"
62
62
 
63
63
  Output: Updated view object.`)).action(async (objectName, viewId, opts) => {
64
64
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -102,7 +102,7 @@ const deleteCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("delete")
102
102
  .argument("<view-id>", "View ID (number)")
103
103
  .addHelpText("after", `
104
104
  Examples:
105
- $ frontline object view delete standard__deals 12
105
+ $ frontline object view delete deals 12
106
106
 
107
107
  Output: { deleted: true, view_id: 12 }`)).action(async (objectName, viewId, opts) => {
108
108
  const client = (0, globalOpts_1.requireClient)(opts);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2KpC,eAAO,MAAM,YAAY,SAiBe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyKpC,eAAO,MAAM,YAAY,SAee,CAAC"}
@@ -9,8 +9,6 @@ const option_1 = require("./option");
9
9
  const row_1 = require("./row");
10
10
  const relation_1 = require("./relation");
11
11
  const export_1 = require("./export");
12
- const note_1 = require("./note");
13
- const task_1 = require("./task");
14
12
  const file_1 = require("./file");
15
13
  const aggregation_1 = require("./aggregation");
16
14
  const listCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("list").description("List all data tables in the account").addHelpText("after", `
@@ -135,8 +133,6 @@ exports.tableCommand = new commander_1.Command("table")
135
133
  .addCommand(row_1.tableRowCommand)
136
134
  .addCommand(relation_1.tableRelationCommand)
137
135
  .addCommand(export_1.tableExportCommand)
138
- .addCommand(note_1.tableNoteCommand)
139
- .addCommand(task_1.tableTaskCommand)
140
136
  .addCommand(file_1.tableFileCommand)
141
137
  .addCommand(aggregation_1.tableAggregationCommand);
142
138
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/table/index.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA0E;AAC1E,6CAA8D;AAE9D,mCAA4C;AAC5C,qCAA8C;AAC9C,+BAAwC;AACxC,yCAAkD;AAClD,qCAA8C;AAC9C,iCAA0C;AAC1C,iCAA0C;AAC1C,iCAA0C;AAC1C,+CAAwD;AAExD,MAAM,OAAO,GAAG,IAAA,uBAAU,EACtB,IAAI,mBAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,qCAAqC,CAAC,CAAC,WAAW,CAC9E,OAAO,EACP;;;;6EAIqE,CACxE,CACJ,CAAC,MAAM,CAAC,KAAK,EAAE,IAAa,EAAE,EAAE;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAU,QAAQ,CAAC,CAAC;IACnD,IAAA,gBAAO,EAAC,MAAM,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAA,uBAAU,EACxB,IAAI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,CAAC;KAC9B,UAAU,CAAC,qBAAe,CAAC;KAC3B,UAAU,CAAC,+BAAoB,CAAC;KAChC,UAAU,CAAC,2BAAkB,CAAC;KAC9B,UAAU,CAAC,uBAAgB,CAAC;KAC5B,UAAU,CAAC,qCAAuB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const toolsCommand: Command;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiFpC,eAAO,MAAM,YAAY,SAWpB,CAAC"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toolsCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const globalOpts_1 = require("../../lib/globalOpts");
6
+ const output_1 = require("../../lib/output");
7
+ function parseJsonOption(value, optionName) {
8
+ if (!value) {
9
+ return undefined;
10
+ }
11
+ try {
12
+ return JSON.parse(value);
13
+ }
14
+ catch (err) {
15
+ const message = err instanceof Error ? err.message : String(err);
16
+ (0, output_1.error)("invalid_json", `${optionName} must be valid JSON: ${message}`, output_1.EXIT_CODES.BAD_INPUT);
17
+ }
18
+ }
19
+ function addToolPayloadOptions(command) {
20
+ return command
21
+ .option("--body <body>", "Raw request body template")
22
+ .option("--arguments <json>", "Tool arguments JSON array")
23
+ .option("--headers <json>", "Headers JSON array")
24
+ .option("--query-params <json>", "Query params JSON array");
25
+ }
26
+ function buildToolPayload(options, includeUndefined = false) {
27
+ const payload = {
28
+ name: options.name,
29
+ description: options.description,
30
+ method: options.method,
31
+ url: options.url,
32
+ body: options.body,
33
+ arguments: parseJsonOption(options.arguments, "--arguments"),
34
+ headers: parseJsonOption(options.headers, "--headers"),
35
+ queryParams: parseJsonOption(options.queryParams, "--query-params"),
36
+ };
37
+ if (options.status) {
38
+ payload.status = options.status;
39
+ }
40
+ if (includeUndefined) {
41
+ return payload;
42
+ }
43
+ return Object.fromEntries(Object.entries(payload).filter(([, value]) => value !== undefined));
44
+ }
45
+ exports.toolsCommand = (0, globalOpts_1.globalOpts)(new commander_1.Command("tools"))
46
+ .description("Manage public API call tools")
47
+ .addHelpText("after", `
48
+ Examples:
49
+ $ frontline tools list --table
50
+ $ frontline tools create --name "Fetch contact" --description "Fetches a CRM contact" --method GET --url "https://api.example.com/contacts/{{contactId}}" --arguments '[{"name":"contactId","dataType":"STRING"}]'
51
+ $ frontline tools describe 123
52
+ $ frontline tools update 123 --status PAUSED
53
+ $ frontline tools delete 123`);
54
+ exports.toolsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("list")
55
+ .description("List API call tools")
56
+ .option("--status <status>", "Filter by status (ACTIVE or PAUSED)")
57
+ .option("--filter-text <text>", "Filter by name or description")).action(async (options) => {
58
+ const client = (0, globalOpts_1.requireClient)(options);
59
+ const data = await client.get("tools", {
60
+ status: options.status,
61
+ filterText: options.filterText,
62
+ });
63
+ if (options.pretty || options.table) {
64
+ (0, output_1.printTable)(data.results, [
65
+ "id",
66
+ "name",
67
+ "status",
68
+ "method",
69
+ "url",
70
+ "updatedAt",
71
+ ]);
72
+ return;
73
+ }
74
+ (0, output_1.success)(data);
75
+ }));
76
+ exports.toolsCommand.addCommand((0, globalOpts_1.globalOpts)(addToolPayloadOptions(new commander_1.Command("create")
77
+ .description("Create an API call tool")
78
+ .requiredOption("--name <name>", "Tool name")
79
+ .requiredOption("--description <description>", "Tool description")
80
+ .requiredOption("--method <method>", "HTTP method (GET, POST, PUT, PATCH, DELETE)")
81
+ .requiredOption("--url <url>", "Tool URL template"))).action(async (options) => {
82
+ const client = (0, globalOpts_1.requireClient)(options);
83
+ const payload = {
84
+ ...buildToolPayload(options),
85
+ type: "API_CALL",
86
+ };
87
+ const tool = await client.post("tools", payload);
88
+ (0, output_1.success)(tool);
89
+ }));
90
+ exports.toolsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("describe").description("Describe a tool").argument("<toolId>", "Tool ID")).action(async (toolId, options) => {
91
+ const client = (0, globalOpts_1.requireClient)(options);
92
+ const tool = await client.get(`tools/${encodeURIComponent(toolId)}`);
93
+ (0, output_1.success)(tool);
94
+ }));
95
+ exports.toolsCommand.addCommand((0, globalOpts_1.globalOpts)(addToolPayloadOptions(new commander_1.Command("update")
96
+ .description("Update an API call tool")
97
+ .argument("<toolId>", "Tool ID")
98
+ .option("--name <name>", "Tool name")
99
+ .option("--description <description>", "Tool description")
100
+ .option("--status <status>", "Tool status (ACTIVE or PAUSED)")
101
+ .option("--method <method>", "HTTP method (GET, POST, PUT, PATCH, DELETE)")
102
+ .option("--url <url>", "Tool URL template"))).action(async (toolId, options) => {
103
+ const client = (0, globalOpts_1.requireClient)(options);
104
+ const payload = buildToolPayload(options);
105
+ const tool = await client.put(`tools/${encodeURIComponent(toolId)}`, payload);
106
+ (0, output_1.success)(tool);
107
+ }));
108
+ exports.toolsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("delete").description("Delete a tool").argument("<toolId>", "Tool ID")).action(async (toolId, options) => {
109
+ const client = (0, globalOpts_1.requireClient)(options);
110
+ await client.delete(`tools/${encodeURIComponent(toolId)}`);
111
+ (0, output_1.success)({ deleted: true, toolId: Number(toolId) });
112
+ }));
113
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/tools/index.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA0E;AAC1E,6CAA0E;AAmC1E,SAAS,eAAe,CAAI,KAAyB,EAAE,UAAkB;IACrE,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,IAAI,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAM,CAAC;IAClC,CAAC;IAAC,OAA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AAC,6BAA6B,EAAE,kBAAkB,CAAC;KACzD,MAAM,CAAC,mBAAmB,EAAE,gCAAgC,CAAC;KAC7D,MAAM,CAAC,mBAAmB,EAAE,6CAA6C,CAAC;KAC1E,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAClD,CACJ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,OAAoB,EAAE,EAAE;IACpD,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,OAAO,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAO,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACpF,IAAA,gBAAO,EAAC,IAAI,CAAC,CAAC;AAClB,CAAC,CAAC,CACL,CAAC;AAEF,oBAAY,CAAC,UAAU,CACnB,IAAA,uBAAU,EACN,IAAI,mBAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,CACrF,CAAC,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,OAAoB,EAAE,EAAE;IACpD,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,OAAO,CAAC,CAAC;IACtC,MAAM,MAAM,CAAC,MAAM,CAAO,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjE,IAAA,gBAAO,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACvD,CAAC,CAAC,CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const utilUuidCommand: Command;
3
+ //# sourceMappingURL=uuid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../../src/commands/util/uuid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,eAAe,SAatB,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.utilUuidCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const crypto_1 = require("crypto");
6
+ exports.utilUuidCommand = new commander_1.Command("uuid")
7
+ .description("Generate a node-formatted UUID ready to use as a nodeId when creating workflow or flow nodes")
8
+ .addHelpText("after", `
9
+ Examples:
10
+ $ frontline util uuid
11
+ node_a1b2c3d4-e5f6-7890-abcd-ef1234567890`)
12
+ .action(() => {
13
+ process.stdout.write(`node_${(0, crypto_1.randomUUID)()}\n`);
14
+ });
15
+ //# sourceMappingURL=uuid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../../src/commands/util/uuid.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,mCAAoC;AAEvB,QAAA,eAAe,GAAG,IAAI,mBAAO,CAAC,MAAM,CAAC;KAC7C,WAAW,CACR,8FAA8F,CACjG;KACA,WAAW,CACR,OAAO,EACP;;;4CAGoC,CACvC;KACA,MAAM,CAAC,GAAG,EAAE;IACT,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,IAAA,mBAAU,GAAE,IAAI,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/commands/workflows/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkCpC,eAAO,MAAM,yBAAyB,SAiDhC,CAAC"}
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/commands/workflows/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoCpC,eAAO,MAAM,yBAAyB,SAsDhC,CAAC"}
@@ -9,9 +9,11 @@ const chalk_1 = __importDefault(require("chalk"));
9
9
  const httpClient_1 = require("../../lib/httpClient");
10
10
  const output_1 = require("../../lib/output");
11
11
  const helpEpilog_1 = require("../../lib/helpEpilog");
12
+ const common_1 = require("./common");
12
13
  exports.workflowsAnalyticsCommand = new commander_1.Command("analytics")
13
- .description("Get analytics for a specific workflow")
14
- .argument("<workflowId>", "Workflow ID")
14
+ .description("Get analytics for a workflow. Uses the active workflow unless an ID is passed")
15
+ .argument("[workflowId]", "Workflow ID")
16
+ .option("--workflow-id <id>", "Workflow ID. Defaults to the active workflow")
15
17
  .option("--start-date <date>", "Start date (YYYY-MM-DD)")
16
18
  .option("--end-date <date>", "End date (YYYY-MM-DD)")
17
19
  .option("--pretty", "Pretty human-readable output")
@@ -20,7 +22,11 @@ exports.workflowsAnalyticsCommand = new commander_1.Command("analytics")
20
22
  .option("--base-url <url>", helpEpilog_1.FRONTLINE_BASE_URL_OPTION)
21
23
  .option("--profile <name>", helpEpilog_1.FRONTLINE_PROFILE_OPTION)
22
24
  .option("--debug", "Show debug information (redacted token)")
23
- .action(async (workflowId, options) => {
25
+ .action(async (workflowIdArg, options) => {
26
+ const workflowId = (0, common_1.resolveWorkflowId)({
27
+ ...options,
28
+ workflowId: workflowIdArg ?? options.workflowId,
29
+ });
24
30
  let data;
25
31
  try {
26
32
  data = await (0, httpClient_1.apiGet)({
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/commands/workflows/analytics.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAoC;AACpC,kDAA0B;AAC1B,qDAA8C;AAC9C,6CAAyF;AACzF,qDAI8B;AA0BjB,QAAA,yBAAyB,GAAG,IAAI,mBAAO,CAAC,WAAW,CAAC;KAC5D,WAAW,CAAC,uCAAuC,CAAC;KACpD,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC;KACvC,MAAM,CAAC,q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,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAC1C,IAAA,mBAAU,EAAC,IAAK,CAAC,UAAkD,EAAE;gBACjE,MAAM;gBACN,WAAW;gBACX,gBAAgB;gBAChB,YAAY;gBACZ,cAAc;aACjB,CAAC,CAAC;QACP,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,IAAA,gBAAO,EAAC,IAAK,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { CliOpts } from "../../lib/globalOpts";
2
+ export interface WorkflowScopedOptions extends CliOpts {
3
+ workflowId?: string;
4
+ }
5
+ export interface Workflow {
6
+ id: number;
7
+ name: string;
8
+ description?: string | null;
9
+ status: string;
10
+ triggerType?: string | null;
11
+ liveSnapshotId?: string | null;
12
+ draftSnapshotId?: string | null;
13
+ nodes?: WorkflowNode[];
14
+ }
15
+ export interface WorkflowNode {
16
+ nodeId: string;
17
+ alias?: string | null;
18
+ name?: string;
19
+ type: string;
20
+ position: {
21
+ positionX: number;
22
+ positionY: number;
23
+ };
24
+ data?: Record<string, unknown> | null;
25
+ handles?: unknown[];
26
+ targetEdges?: unknown[];
27
+ }
28
+ export interface WorkflowGraph {
29
+ id?: string;
30
+ entityId: number;
31
+ type: string;
32
+ nodes: WorkflowNode[];
33
+ }
34
+ export declare function parseJsonOption<T>(value: string | undefined, optionName: string): T;
35
+ export declare function resolveWorkflowId(opts: WorkflowScopedOptions): number;
36
+ export declare function saveActiveWorkflowId(workflowId: number, opts: {
37
+ profile?: string;
38
+ }): void;
39
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/commands/workflows/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAI/C,MAAM,WAAW,qBAAsB,SAAQ,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IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAOzF"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseJsonOption = parseJsonOption;
4
+ exports.resolveWorkflowId = resolveWorkflowId;
5
+ exports.saveActiveWorkflowId = saveActiveWorkflowId;
6
+ const config_1 = require("../../lib/config");
7
+ const output_1 = require("../../lib/output");
8
+ function parseJsonOption(value, optionName) {
9
+ if (!value) {
10
+ (0, output_1.error)("missing_json", `${optionName} is required`, output_1.EXIT_CODES.BAD_INPUT);
11
+ }
12
+ try {
13
+ return JSON.parse(value);
14
+ }
15
+ catch (err) {
16
+ const message = err instanceof Error ? err.message : String(err);
17
+ (0, output_1.error)("invalid_json", `${optionName} must be valid JSON: ${message}`, output_1.EXIT_CODES.BAD_INPUT);
18
+ }
19
+ }
20
+ function resolveWorkflowId(opts) {
21
+ if (opts.workflowId) {
22
+ const workflowId = Number(opts.workflowId);
23
+ if (!Number.isInteger(workflowId) || workflowId <= 0) {
24
+ (0, output_1.error)("invalid_workflow_id", "--workflow-id must be a positive integer", output_1.EXIT_CODES.BAD_INPUT);
25
+ }
26
+ return workflowId;
27
+ }
28
+ const activeWorkflowId = (0, config_1.getActiveWorkflowId)(opts.profile);
29
+ if (!activeWorkflowId) {
30
+ (0, output_1.error)("workflow_not_selected", "No active workflow selected", output_1.EXIT_CODES.BAD_INPUT, {
31
+ suggestion: "Run 'frontline workflows use <workflow-id>' or pass --workflow-id to this command.",
32
+ });
33
+ }
34
+ return activeWorkflowId;
35
+ }
36
+ function saveActiveWorkflowId(workflowId, opts) {
37
+ try {
38
+ (0, config_1.setActiveWorkflowId)(workflowId, opts.profile);
39
+ }
40
+ catch (err) {
41
+ const message = err instanceof Error ? err.message : String(err);
42
+ (0, output_1.error)("workflow_context_error", message, output_1.EXIT_CODES.GENERAL_ERROR);
43
+ }
44
+ }
45
+ //# sourceMappingURL=common.js.map
@@ -0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A6B,EAAE,mBAAU,CAAC,SAAS,EAAE;YAChF,UAAU,EACN,oFAAoF;SAC3F,CAAC,CAAC;IACP,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC5B,CAAC;AAED,SAAgB,oBAAoB,CAAC,UAAkB,EAAE,IAA0B;IAC/E,IAAI,CAAC;QACD,IAAA,4BAAmB,EAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,IAAA,cAAK,EAAC,wBAAwB,EAAE,OAAO,EAAE,mBAAU,CAAC,aAAa,CAAC,CAAC;IACvE,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const workflowsCreateCommand: Command;
3
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/workflows/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,eAAO,MAAM,sBAAsB,SAwCjC,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workflowsCreateCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const globalOpts_1 = require("../../lib/globalOpts");
6
+ const output_1 = require("../../lib/output");
7
+ const common_1 = require("./common");
8
+ exports.workflowsCreateCommand = (0, globalOpts_1.globalOpts)(new commander_1.Command("create")
9
+ .description("Create a workflow automation and select it as the active workflow")
10
+ .requiredOption("--name <name>", "Workflow name")
11
+ .option("--description <description>", "Workflow description")
12
+ .option("--no-use", "Do not set the created workflow as active")
13
+ .addHelpText("after", `
14
+ Examples:
15
+ $ frontline workflows create --name "Daily CRM Sync"
16
+ $ frontline workflows create --name "Daily CRM Sync" --description "Sync contacts every day"
17
+
18
+ Output: Created workflow. By default the CLI saves it as the active workflow for the current profile.`)).action(async (opts) => {
19
+ const client = (0, globalOpts_1.requireClient)(opts);
20
+ const workflow = await client.post("workflows", {
21
+ name: opts.name,
22
+ description: opts.description,
23
+ });
24
+ if (opts.use !== false) {
25
+ (0, common_1.saveActiveWorkflowId)(workflow.id, opts);
26
+ }
27
+ if (opts.pretty || opts.table) {
28
+ (0, output_1.printKeyValue)({
29
+ id: workflow.id,
30
+ name: workflow.name,
31
+ status: workflow.status,
32
+ activeWorkflow: opts.use !== false,
33
+ });
34
+ return;
35
+ }
36
+ (0, output_1.success)({
37
+ ...workflow,
38
+ activeWorkflow: opts.use !== false,
39
+ });
40
+ });
41
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/workflows/create.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA0E;AAC1E,6CAA0D;AAC1D,qCAA0D;AAQ7C,QAAA,sBAAsB,GAAG,IAAA,uBAAU,EAC5C,IAAI,mBAAO,CAAC,QAAQ,CAAC;KAChB,WAAW,CAAC,mEAAmE,CAAC;KAChF,cAAc,CAAC,eAAe,EAAE,eAAe,CAAC;KAChD,MAAM,CAAC,6BAA6B,EAAE,sBAAsB,CAAC;KAC7D,MAAM,CAAC,UAAU,EAAE,2CAA2C,CAAC;KAC/D,WAAW,CACR,OAAO,EACP;;;;;sGAK0F,CAC7F,CACR,CAAC,MAAM,CAAC,KAAK,EAAE,IAA4B,EAAE,EAAE;IAC5C,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAW,WAAW,EAAE;QACtD,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,IAAI,CAAC,WAAW;KAChC,CAAC,CAAC;IAEH,IAAI,IAAI,CAAC,GAAG,KAAK,KAAK,EAAE,CAAC;QACrB,IAAA,6BAAoB,EAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC5B,IAAA,sBAAa,EAAC;YACV,EAAE,EAAE,QAAQ,CAAC,EAAE;YACf,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,cAAc,EAAE,IAAI,CAAC,GAAG,KAAK,KAAK;SACrC,CAAC,CAAC;QACH,OAAO;IACX,CAAC;IAED,IAAA,gBAAO,EAAC;QACJ,GAAG,QAAQ;QACX,cAAc,EAAE,IAAI,CAAC,GAAG,KAAK,KAAK;KACrC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const workflowsDeleteCommand: Command;
3
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/workflows/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,sBAAsB,SAgBjC,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workflowsDeleteCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const globalOpts_1 = require("../../lib/globalOpts");
6
+ const output_1 = require("../../lib/output");
7
+ const common_1 = require("./common");
8
+ exports.workflowsDeleteCommand = (0, globalOpts_1.globalOpts)(new commander_1.Command("delete")
9
+ .description("Delete the active workflow or the workflow passed with --workflow-id")
10
+ .option("--workflow-id <id>", "Workflow ID. Defaults to the active workflow")
11
+ .addHelpText("after", `
12
+ Examples:
13
+ $ frontline workflows delete
14
+ $ frontline workflows delete --workflow-id 42`)).action(async (opts) => {
15
+ const workflowId = (0, common_1.resolveWorkflowId)(opts);
16
+ const client = (0, globalOpts_1.requireClient)(opts);
17
+ await client.delete(`workflows/${workflowId}`);
18
+ (0, output_1.success)({ deleted: true, workflowId });
19
+ });
20
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/workflows/delete.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAAiE;AACjE,6CAA2C;AAC3C,qCAAoE;AAEvD,QAAA,sBAAsB,GAAG,IAAA,uBAAU,EAC5C,IAAI,mBAAO,CAAC,QAAQ,CAAC;KAChB,WAAW,CAAC,sEAAsE,CAAC;KACnF,MAAM,CAAC,oBAAoB,EAAE,8CAA8C,CAAC;KAC5E,WAAW,CACR,OAAO,EACP;;;gDAGoC,CACvC,CACR,CAAC,MAAM,CAAC,KAAK,EAAE,IAA2B,EAAE,EAAE;IAC3C,MAAM,UAAU,GAAG,IAAA,0BAAiB,EAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,MAAM,CAAC,MAAM,CAAO,aAAa,UAAU,EAAE,CAAC,CAAC;IACrD,IAAA,gBAAO,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const workflowsDescribeCommand: Command;
3
+ //# sourceMappingURL=describe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../../src/commands/workflows/describe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,eAAO,MAAM,wBAAwB,SAwCnC,CAAC"}