@getfrontline/cli 1.0.4 → 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 (104) hide show
  1. package/README.md +168 -2
  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/tools/index.d.ts +3 -0
  30. package/dist/commands/tools/index.d.ts.map +1 -0
  31. package/dist/commands/tools/index.js +113 -0
  32. package/dist/commands/tools/index.js.map +1 -0
  33. package/dist/commands/util/uuid.d.ts +3 -0
  34. package/dist/commands/util/uuid.d.ts.map +1 -0
  35. package/dist/commands/util/uuid.js +15 -0
  36. package/dist/commands/util/uuid.js.map +1 -0
  37. package/dist/commands/workflows/analytics.d.ts.map +1 -1
  38. package/dist/commands/workflows/analytics.js +9 -3
  39. package/dist/commands/workflows/analytics.js.map +1 -1
  40. package/dist/commands/workflows/common.d.ts +39 -0
  41. package/dist/commands/workflows/common.d.ts.map +1 -0
  42. package/dist/commands/workflows/common.js +45 -0
  43. package/dist/commands/workflows/common.js.map +1 -0
  44. package/dist/commands/workflows/create.d.ts +3 -0
  45. package/dist/commands/workflows/create.d.ts.map +1 -0
  46. package/dist/commands/workflows/create.js +41 -0
  47. package/dist/commands/workflows/create.js.map +1 -0
  48. package/dist/commands/workflows/delete.d.ts +3 -0
  49. package/dist/commands/workflows/delete.d.ts.map +1 -0
  50. package/dist/commands/workflows/delete.js +20 -0
  51. package/dist/commands/workflows/delete.js.map +1 -0
  52. package/dist/commands/workflows/describe.d.ts +3 -0
  53. package/dist/commands/workflows/describe.d.ts.map +1 -0
  54. package/dist/commands/workflows/describe.js +40 -0
  55. package/dist/commands/workflows/describe.js.map +1 -0
  56. package/dist/commands/workflows/edges.d.ts +3 -0
  57. package/dist/commands/workflows/edges.d.ts.map +1 -0
  58. package/dist/commands/workflows/edges.js +50 -0
  59. package/dist/commands/workflows/edges.js.map +1 -0
  60. package/dist/commands/workflows/graph.d.ts +3 -0
  61. package/dist/commands/workflows/graph.d.ts.map +1 -0
  62. package/dist/commands/workflows/graph.js +47 -0
  63. package/dist/commands/workflows/graph.js.map +1 -0
  64. package/dist/commands/workflows/nodes.d.ts +3 -0
  65. package/dist/commands/workflows/nodes.d.ts.map +1 -0
  66. package/dist/commands/workflows/nodes.js +68 -0
  67. package/dist/commands/workflows/nodes.js.map +1 -0
  68. package/dist/commands/workflows/update.d.ts +3 -0
  69. package/dist/commands/workflows/update.d.ts.map +1 -0
  70. package/dist/commands/workflows/update.js +42 -0
  71. package/dist/commands/workflows/update.js.map +1 -0
  72. package/dist/commands/workflows/use.d.ts +3 -0
  73. package/dist/commands/workflows/use.d.ts.map +1 -0
  74. package/dist/commands/workflows/use.js +34 -0
  75. package/dist/commands/workflows/use.js.map +1 -0
  76. package/dist/commands/workflows/variables.d.ts +3 -0
  77. package/dist/commands/workflows/variables.d.ts.map +1 -0
  78. package/dist/commands/workflows/variables.js +105 -0
  79. package/dist/commands/workflows/variables.js.map +1 -0
  80. package/dist/index.js +50 -1
  81. package/dist/index.js.map +1 -1
  82. package/dist/lib/config.d.ts +9 -0
  83. package/dist/lib/config.d.ts.map +1 -1
  84. package/dist/lib/config.js +54 -0
  85. package/dist/lib/config.js.map +1 -1
  86. package/dist/lib/httpClient.d.ts +2 -1
  87. package/dist/lib/httpClient.d.ts.map +1 -1
  88. package/dist/lib/httpClient.js +5 -2
  89. package/dist/lib/httpClient.js.map +1 -1
  90. package/dist/max.js +7 -1
  91. package/dist/max.js.map +1 -1
  92. package/dist/scripts/postinstall.d.ts.map +1 -1
  93. package/dist/scripts/postinstall.js +8 -0
  94. package/dist/scripts/postinstall.js.map +1 -1
  95. package/dist/skills/agent-builder/SKILL.md +88 -0
  96. package/dist/skills/ai-models/SKILL.md +43 -0
  97. package/dist/skills/flow-builder/SKILL.md +124 -0
  98. package/dist/skills/frontline-agents/SKILL.md +152 -3
  99. package/dist/skills/frontline-workflows/SKILL.md +170 -3
  100. package/dist/skills/incoming-webhooks/SKILL.md +36 -0
  101. package/dist/skills/tools/SKILL.md +65 -0
  102. package/dist/skills/variables/SKILL.md +82 -0
  103. package/dist/skills/workflow-builder/SKILL.md +426 -0
  104. package/package.json +1 -1
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.agentsVariablesCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const globalOpts_1 = require("../../lib/globalOpts");
6
+ const config_1 = require("../../lib/config");
7
+ const output_1 = require("../../lib/output");
8
+ function resolveAgentId(opts) {
9
+ const agentId = opts.agentId || (0, config_1.getActiveAgentId)(opts.profile);
10
+ if (!agentId) {
11
+ (0, output_1.error)("agent_not_selected", "No active agent selected", output_1.EXIT_CODES.BAD_INPUT, {
12
+ suggestion: "Run 'frontline agents use <agent-id>' or pass --agent-id.",
13
+ });
14
+ }
15
+ return agentId;
16
+ }
17
+ function variablePayload(options) {
18
+ return {
19
+ name: options.name,
20
+ description: options.description,
21
+ pattern: options.pattern,
22
+ };
23
+ }
24
+ exports.agentsVariablesCommand = (0, globalOpts_1.globalOpts)(new commander_1.Command("variables"))
25
+ .description("Manage variables for the active agent")
26
+ .addHelpText("after", `
27
+ Examples:
28
+ $ frontline agents variables list --table
29
+ $ frontline agents variables all
30
+ $ frontline agents variables create --name customer_name --description "Customer name"
31
+ $ frontline agents variables update 123 --name customer_name --pattern "^[A-Za-z ]+$"
32
+ $ frontline agents variables check-name customer_name`);
33
+ exports.agentsVariablesCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("list")
34
+ .description("List agent variables")
35
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
36
+ .option("--filter-text <text>", "Filter by name or description")
37
+ .option("--is-default <true|false>", "Filter default variables")).action(async (options) => {
38
+ const agentId = resolveAgentId(options);
39
+ const client = (0, globalOpts_1.requireClient)(options);
40
+ const data = await client.get(`agents/${encodeURIComponent(agentId)}/variables`, { filterText: options.filterText, isDefault: options.isDefault });
41
+ if (options.pretty || options.table) {
42
+ (0, output_1.printTable)(data.results, [
43
+ "id",
44
+ "name",
45
+ "status",
46
+ "isDefault",
47
+ "pattern",
48
+ ]);
49
+ return;
50
+ }
51
+ (0, output_1.success)(data);
52
+ }));
53
+ exports.agentsVariablesCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("all")
54
+ .description("List all agent variables including defaults")
55
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")).action(async (options) => {
56
+ const agentId = resolveAgentId(options);
57
+ const client = (0, globalOpts_1.requireClient)(options);
58
+ const data = await client.get(`agents/${encodeURIComponent(agentId)}/variables/all`);
59
+ (0, output_1.success)(data);
60
+ }));
61
+ exports.agentsVariablesCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("create")
62
+ .description("Create an agent variable")
63
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
64
+ .requiredOption("--name <name>", "Variable name")
65
+ .option("--description <description>", "Variable description")
66
+ .option("--pattern <pattern>", "Optional validation pattern")).action(async (options) => {
67
+ const agentId = resolveAgentId(options);
68
+ const client = (0, globalOpts_1.requireClient)(options);
69
+ const variable = await client.post(`agents/${encodeURIComponent(agentId)}/variables`, variablePayload(options));
70
+ (0, output_1.success)(variable);
71
+ }));
72
+ exports.agentsVariablesCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("describe")
73
+ .description("Describe an agent variable")
74
+ .argument("<variableId>", "Variable ID")
75
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")).action(async (variableId, options) => {
76
+ const agentId = resolveAgentId(options);
77
+ const client = (0, globalOpts_1.requireClient)(options);
78
+ const variable = await client.get(`agents/${encodeURIComponent(agentId)}/variables/${variableId}`);
79
+ (0, output_1.success)(variable);
80
+ }));
81
+ exports.agentsVariablesCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("update")
82
+ .description("Update an agent variable")
83
+ .argument("<variableId>", "Variable ID")
84
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
85
+ .requiredOption("--name <name>", "Variable name")
86
+ .option("--description <description>", "Variable description")
87
+ .option("--pattern <pattern>", "Optional validation pattern")).action(async (variableId, options) => {
88
+ const agentId = resolveAgentId(options);
89
+ const client = (0, globalOpts_1.requireClient)(options);
90
+ const variable = await client.put(`agents/${encodeURIComponent(agentId)}/variables/${variableId}`, variablePayload(options));
91
+ (0, output_1.success)(variable);
92
+ }));
93
+ exports.agentsVariablesCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("delete")
94
+ .description("Delete an agent variable")
95
+ .argument("<variableId>", "Variable ID")
96
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")).action(async (variableId, options) => {
97
+ const agentId = resolveAgentId(options);
98
+ const client = (0, globalOpts_1.requireClient)(options);
99
+ await client.delete(`agents/${encodeURIComponent(agentId)}/variables/${variableId}`);
100
+ (0, output_1.success)({ deleted: true, variableId: Number(variableId) });
101
+ }));
102
+ exports.agentsVariablesCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("check-name")
103
+ .description("Check whether an agent variable name exists")
104
+ .argument("<name>", "Variable name")
105
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")).action(async (name, options) => {
106
+ const agentId = resolveAgentId(options);
107
+ const client = (0, globalOpts_1.requireClient)(options);
108
+ const result = await client.get(`agents/${encodeURIComponent(agentId)}/variables/check-name`, { name });
109
+ (0, output_1.success)(result);
110
+ }));
111
+ //# sourceMappingURL=variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variables.js","sourceRoot":"","sources":["../../../src/commands/agents/variables.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA0E;AAC1E,6CAAoD;AACpD,6CAA0E;AAyB1E,SAAS,cAAc,CAAC,IAA0B;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,IAAA,yBAAgB,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,IAAA,cAAK,EAAC,oBAAoB,EAAE,0BAA0B,EAAE,mBAAU,CAAC,SAAS,EAAE;YAC1E,UAAU,EAAE,2DAA2D;SAC1E,CAAC,CAAC;IACP,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,SAAS,eAAe,CAAC,OAA6B;IAClD,OAAO;QACH,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,OAAO,EAAE,OAAO,CAAC,OAAO;KAC3B,CAAC;AACN,CAAC;AAEY,QAAA,sBAAsB,GAAG,IAAA,uBAAU,EAAC,IAA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EAAE,aAAa,CAAC;KACvC,MAAM,CAAC,iBAAiB,EAAE,wCAAwC,CAAC,CAC3E,CAAC,MAAM,CAAC,KAAK,EAAE,UAAkB,EAAE,OAA6B,EAAE,EAAE;IACjE,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,OAAO,CAAC,CAAC;IACtC,MAAM,MAAM,CAAC,MAAM,CAAO,UAAU,kBAAkB,CAAC,OAAO,CAAC,cAAc,UAAU,EAAE,CAAC,CAAC;IAC3F,IAAA,gBAAO,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AAC/D,CAAC,CAAC,CACL,CAAC;AAEF,8BAAsB,CAAC,UAAU,CAC7B,IAAA,uBAAU,EACN,IAAI,mBAAO,CAAC,YAAY,CAAC;KACpB,WAAW,CAAC,6CAA6C,CAAC;KAC1D,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;KACnC,MAAM,CAAC,iBAAiB,EAAE,wCAAwC,CAAC,CAC3E,CAAC,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,OAA6B,EAAE,EAAE;IAC3D,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,OAAO,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAC3B,UAAU,kBAAkB,CAAC,OAAO,CAAC,uBAAuB,EAC5D,EAAE,IAAI,EAAE,CACX,CAAC;IACF,IAAA,gBAAO,EAAC,MAAM,CAAC,CAAC;AACpB,CAAC,CAAC,CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const aiModelsCommand: Command;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/aiModels/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwCpC,eAAO,MAAM,eAAe,SAUvB,CAAC"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aiModelsCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const globalOpts_1 = require("../../lib/globalOpts");
6
+ const output_1 = require("../../lib/output");
7
+ function assertModelType(type) {
8
+ if (!type)
9
+ return undefined;
10
+ if (type !== "TEXT" && type !== "TRANSCRIPTION") {
11
+ (0, output_1.error)("invalid_model_type", "--type must be either TEXT or TRANSCRIPTION", output_1.EXIT_CODES.BAD_INPUT);
12
+ }
13
+ return type;
14
+ }
15
+ exports.aiModelsCommand = (0, globalOpts_1.globalOpts)(new commander_1.Command("ai-models"))
16
+ .description("Discover available AI models")
17
+ .addHelpText("after", `
18
+ Examples:
19
+ $ frontline ai-models list --table
20
+ $ frontline ai-models list --type TRANSCRIPTION
21
+ $ frontline ai-models default --type TEXT
22
+ $ frontline ai-models describe 1`);
23
+ exports.aiModelsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("list")
24
+ .description("List available AI models")
25
+ .option("--type <type>", "Model type: TEXT or TRANSCRIPTION")).action(async (options) => {
26
+ const client = (0, globalOpts_1.requireClient)(options);
27
+ const data = await client.get("ai-models", {
28
+ type: assertModelType(options.type),
29
+ });
30
+ if (options.pretty || options.table) {
31
+ (0, output_1.printTable)(data.results, [
32
+ "id",
33
+ "name",
34
+ "externalId",
35
+ "aiVendor",
36
+ "type",
37
+ "isDefault",
38
+ "creditsPerMessage",
39
+ ]);
40
+ return;
41
+ }
42
+ (0, output_1.success)(data);
43
+ }));
44
+ exports.aiModelsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("default")
45
+ .description("Get the default AI model")
46
+ .option("--type <type>", "Model type: TEXT or TRANSCRIPTION")).action(async (options) => {
47
+ const client = (0, globalOpts_1.requireClient)(options);
48
+ const model = await client.get("ai-models/default", {
49
+ type: assertModelType(options.type),
50
+ });
51
+ (0, output_1.success)(model);
52
+ }));
53
+ exports.aiModelsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("describe")
54
+ .description("Describe an AI model")
55
+ .argument("<aiModelId>", "AI model ID")).action(async (aiModelId, options) => {
56
+ const client = (0, globalOpts_1.requireClient)(options);
57
+ const model = await client.get(`ai-models/${encodeURIComponent(aiModelId)}`);
58
+ (0, output_1.success)(model);
59
+ }));
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/aiModels/index.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA0E;AAC1E,6CAA0E;AA0B1E,SAAS,eAAe,CAAC,IAAwB;IAC7C,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;QAC9C,IAAA,cAAK,EACD,oBAAoB,EACpB,6CAA6C,EAC7C,mBAAU,CAAC,SAAS,CACvB,CAAC;IACN,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAEY,QAAA,eAAe,GAAG,IAAA,uBAAU,EAAC,IAAI,mBAAO,CAAC,WAAW,CAAC,CAAC;KAC9D,WAAW,CAAC,8BAA8B,CAAC;KAC3C,WAAW,CACR,OAAO,EACP;;;;;mCAK2B,CAC9B,CAAC;AAEN,uBAAe,CAAC,UAAU,CACtB,IAAA,uBAAU,EACN,IAAI,mBAAO,CAAC,MAAM,CAAC;KACd,WAAW,CAAC,0BAA0B,CAAC;KACvC,MAAM,CAAC,eAAe,EAAE,mCAAmC,CAAC,CACpE,CAAC,MAAM,CAAC,KAAK,EAAE,OAAuB,EAAE,EAAE;IACvC,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,OAAO,CAAC,CA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C,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,GAAG,CAAU,aAAa,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACtF,IAAA,gBAAO,EAAC,KAAK,CAAC,CAAC;AACnB,CAAC,CAAC,CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const incomingWebhooksCommand: Command;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/incomingWebhooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBpC,eAAO,MAAM,uBAAuB,SAQ/B,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.incomingWebhooksCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const globalOpts_1 = require("../../lib/globalOpts");
6
+ const output_1 = require("../../lib/output");
7
+ exports.incomingWebhooksCommand = (0, globalOpts_1.globalOpts)(new commander_1.Command("incoming-webhooks"))
8
+ .description("Manage incoming webhooks")
9
+ .addHelpText("after", `
10
+ Examples:
11
+ $ frontline incoming-webhooks create --name "CRM payload"
12
+ $ frontline incoming-webhooks create --name "CRM payload" --description "Receives contacts" --no-authentication`);
13
+ exports.incomingWebhooksCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("create")
14
+ .description("Create an incoming webhook")
15
+ .requiredOption("--name <name>", "Incoming webhook name")
16
+ .option("--description <description>", "Incoming webhook description")
17
+ .option("--inactive", "Create the webhook disabled")
18
+ .option("--no-authentication", "Create the webhook without bearer token authentication")).action(async (options) => {
19
+ const client = (0, globalOpts_1.requireClient)(options);
20
+ const webhook = await client.post("incoming-webhooks", {
21
+ name: options.name,
22
+ description: options.description,
23
+ isActive: options.active !== false,
24
+ useAuthentication: options.noAuthentication !== true,
25
+ });
26
+ (0, output_1.success)(webhook);
27
+ }));
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/incomingWebhooks/index.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA0E;AAC1E,6CAA2C;AAqB9B,QAAA,uBAAuB,GAAG,IAAA,uBAAU,EAAC,IAAI,mBAAO,CAAC,mBAAmB,CAAC,CAAC;KAC9E,WAAW,CAAC,0BAA0B,CAAC;KACvC,WAAW,CACR,OAAO,EACP;;;kHAG0G,CAC7G,CAAC;AAEN,+BAAuB,CAAC,UAAU,CAC9B,IAAA,uBAAU,EACN,IAAI,mBAAO,CAAC,QAAQ,CAAC;KAChB,WAAW,CAAC,4BAA4B,CAAC;KACzC,cAAc,CAAC,eAAe,EAAE,uBAAuB,CAAC;KACxD,MAAM,CAAC,6BAA6B,EAAE,8BAA8B,CAAC;KACrE,MAAM,CAAC,YAAY,EAAE,6BAA6B,CAAC;KACnD,MAAM,CACH,qBAAqB,EACrB,wDAAwD,CAC3D,CACR,CAAC,MAAM,CAAC,KAAK,EAAE,OAA+B,EAAE,EAAE;IAC/C,MAAM,MAAM,GAAG,IAAA,0BAAa,EAAC,OAAO,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,CAAkB,mBAAmB,EAAE;QACpE,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,QAAQ,EAAE,OAAO,CAAC,MAAM,KAAK,KAAK;QAClC,iBAAiB,EAAE,OAAO,CAAC,gBAAgB,KAAK,IAAI;KACvD,CAAC,CAAC;IAEH,IAAA,gBAAO,EAAC,OAAO,CAAC,CAAC;AACrB,CAAC,CAAC,CACL,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,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,cAAc,EAAE,GAAG,UAAU,wBAAwB,OAAO,EAAE,EAAE,mBAAU,CAAC,SAAS,CAAC,CAAC;IAChG,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,OAAgB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C;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,qBAAqB,EAAE,yBAAyB,CAAC;KACxD,MAAM,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;KACpD,MAAM,CAAC,UAAU,EAAE,8BAA8B,CAAC;KAClD,MAAM,CAAC,SAAS,EAAE,iBAAiB,CAAC;KACpC,MAAM,CAAC,iBAAiB,EAAE,qCAAwB,CAAC;KACnD,MAAM,CAAC,kBAAkB,EAAE,sCAAyB,CAAC;KACrD,MAAM,CAAC,kBAAkB,EAAE,qCAAwB,CAAC;KAC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AAC,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,OAAO;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACN,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC,CAWnF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAsBrE;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;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,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/commands/workflows/common.ts"],"names":[],"mappings":";;AAwCA,0CAWC;AAED,8CAsBC;AAED,oDAOC;AAnFD,6CAA4E;AAC5E,6CAAqD;AAsCrD,SAAgB,eAAe,CAAI,KAAyB,EAAE,UAAkB;IAC5E,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,IAAA,cAAK,EAAC,cAAc,EAAE,GAAG,UAAU,cAAc,EAAE,mBAAU,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ACpB,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"}