@keystrokehq/cli 0.0.32 → 0.0.38
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 +25 -4
- package/dist/{accept.handler-DNfIXPSP.mjs → accept.handler-CykuBpt6.mjs} +4 -4
- package/dist/{admin-CJp8XksD.mjs → admin-gRjPC3eD.mjs} +10 -10
- package/dist/{agent-manifest-De5TCxZq.mjs → agent-manifest-DfWD5tvv.mjs} +17 -27
- package/dist/{agents-G37PM35Z.mjs → agents-BpyuvM9p.mjs} +9 -9
- package/dist/{api-keys-4igNHJ_W.mjs → api-keys-BSKhdD_x.mjs} +6 -6
- package/dist/{api-BK3EhPvs.mjs → api-sWkB_Wta.mjs} +1 -1
- package/dist/{auth-CIOmmV4x.mjs → auth-DCgToFf5.mjs} +6 -6
- package/dist/{auth.handler-CznN_vfz.mjs → auth.handler-QRQAEUJC.mjs} +3 -3
- package/dist/authored-workflow-ref-BRCQgyWl.mjs +113 -0
- package/dist/{build-agents-DseUtzd4-CSGpNXur.mjs → build-agents-CUzBnlAG-3ePFZiJ6.mjs} +12 -11
- package/dist/{build-progress-DLM1Bt4T.mjs → build-progress-D_SQqdHA.mjs} +2 -2
- package/dist/{build-tasks-C09SdfjC-BmAVLTtQ.mjs → build-tasks-5eOvI19S-tbN6CRx9.mjs} +4 -4
- package/dist/{build-workflows-BZ_m97Pr-BiyptCrn.mjs → build-workflows-C-gQM3l5-_zcBHE3M.mjs} +14 -9
- package/dist/{build.handler-zHimoO7c.mjs → build.handler-DGQn_clk.mjs} +12 -9
- package/dist/{clear-cache.handler-BP0K1-uN.mjs → clear-cache.handler-gJpwslkK.mjs} +2 -2
- package/dist/{clear.handler-PsA5QKHx.mjs → clear.handler-CuXYvUj2.mjs} +2 -2
- package/dist/{clear.handler-T27GpgSu.mjs → clear.handler-DnjvgyMj.mjs} +1 -1
- package/dist/{commander-BlrSdFcu.mjs → commander-B_8QwPpe.mjs} +22 -3
- package/dist/{connect-BbLJhlIA.mjs → connect-DV9lhP6C.mjs} +3 -3
- package/dist/{connect.handler-BthE-7Wg.mjs → connect.handler-D6JzuFuT.mjs} +5 -5
- package/dist/{context-sgKhRc5v.mjs → context-Brc9VGV9.mjs} +4 -4
- package/dist/{create.handler-BovbO_g0.mjs → create.handler-D_tmjANR.mjs} +3 -3
- package/dist/{credential-env-map-CRs0llf0.mjs → credential-env-map-5a41jLwM.mjs} +1 -1
- package/dist/{credential-requirements-D0mavK8j-CFMf0Xwu.mjs → credential-requirements-B5Alhu1v-DanlSKnT.mjs} +3 -3
- package/dist/{credential-schema-mismatch-ClQgEVtO.mjs → credential-schema-mismatch-CStYUB2h.mjs} +1 -1
- package/dist/{credentials-DKrSaaLw.mjs → credentials-DtwLbee6.mjs} +1 -1
- package/dist/{credentials-CsncZ52a.mjs → credentials-UDrvrKj-.mjs} +10 -10
- package/dist/current-deployment-workflow-CknsHF5T.mjs +20 -0
- package/dist/current.handler-Cy91EeLU.mjs +19 -0
- package/dist/{delete.handler-DkAK396w.mjs → delete.handler-rUDDUrDQ.mjs} +2 -2
- package/dist/{deploy-DvPfR9fC.mjs → deploy-DgWPlEKO.mjs} +2 -2
- package/dist/{deploy-progress-BsUH7fGE.mjs → deploy-progress-BDOCSm_U.mjs} +2 -2
- package/dist/{deploy.handler-BW3f2N2G.mjs → deploy.handler-BDCHCk_A.mjs} +16 -16
- package/dist/{diff-utils-Bs--xmoV.mjs → diff-utils-YEUYtSRs.mjs} +1 -1
- package/dist/{diff.handler-BwhsoAg0.mjs → diff.handler-CGERP-Qn.mjs} +15 -9
- package/dist/{dist-Dw7gCE7y.mjs → dist-B5jy238v.mjs} +37 -11
- package/dist/{dist-CTEtWDW4.mjs → dist-BmbFJq8U.mjs} +8 -27
- package/dist/{env.handler-Dks6ZQh-.mjs → env.handler--8FRrSlJ.mjs} +52 -29
- package/dist/{error-boundary-0veZ_RDS.mjs → error-boundary-D2DiCLAp.mjs} +3 -3
- package/dist/{iam-command-utils-CSZj4XlH.mjs → iam-command-utils-D01Gw8-M.mjs} +3 -13
- package/dist/{import-module-y0glInUe-DV_3dsU0.mjs → import-module-y0glInUe-EuAWaw9g.mjs} +506 -128
- package/dist/{init-BOCDwqKR.mjs → init-Mpe_8lA_.mjs} +3 -3
- package/dist/{init.handler-B3T4J6u_.mjs → init.handler-BjLAIAmm.mjs} +5 -5
- package/dist/{inspect.handler-v9snxDLi.mjs → inspect.handler-CXCi7fhH.mjs} +24 -13
- package/dist/{integration-catalog-CiZ62hb_.mjs → integration-catalog-mZs6EAlN.mjs} +3 -3
- package/dist/{integrations-m7_tb3GV.mjs → integrations-D_IH5Ud1.mjs} +7 -7
- package/dist/{invites-BuatfJmN.mjs → invites-CWWz4wmY.mjs} +5 -5
- package/dist/{invites.list.handler-CK6mL10z.mjs → invites.list.handler-CQLWSoWo.mjs} +6 -5
- package/dist/{invites.resend.handler-CKZouK1Z.mjs → invites.resend.handler-CeIGE_qM.mjs} +6 -5
- package/dist/{invites.revoke.handler-H0VI-3sp.mjs → invites.revoke.handler-9K6jkym_.mjs} +6 -5
- package/dist/keystroke.mjs +139 -82
- package/dist/{list-enrichment-DP1wEyBZ.mjs → list-enrichment-dqbkXJzy.mjs} +2 -2
- package/dist/list.handler-BvuxTFLe.mjs +64 -0
- package/dist/list.handler-CDWPmiMy.mjs +39 -0
- package/dist/{list.handler-DVnFrlis.mjs → list.handler-Co32_F3n.mjs} +7 -7
- package/dist/{list.handler-CMRQKH4b.mjs → list.handler-Cuw1fWO_.mjs} +41 -12
- package/dist/{list.handler-DbYUk6ko.mjs → list.handler-D-rSyrX0.mjs} +5 -5
- package/dist/{list.handler-DIMWZx78.mjs → list.handler-DMvq96UA.mjs} +4 -4
- package/dist/{list.handler-LxZInip2.mjs → list.handler-DUTNS8du.mjs} +4 -4
- package/dist/{list.handler-BiY5NFWd.mjs → list.handler-Dz-Yeijp.mjs} +3 -3
- package/dist/list2.handler-BpqKZTZk.mjs +99 -0
- package/dist/{listen-C_7Rgwkb.mjs → listen-CeNwufij.mjs} +3 -3
- package/dist/{listen.handler-dJgorIzr.mjs → listen.handler-CfRoaOwu.mjs} +4 -4
- package/dist/{logs-B9YMhUGt.mjs → logs-B7k2_W1R.mjs} +3 -3
- package/dist/{logs.handler-DGGVPMOX.mjs → logs.handler-BIqJ0FED.mjs} +1 -1
- package/dist/{logs.handler-BfjCsAyq.mjs → logs.handler-CSqOzxCU.mjs} +26 -29
- package/dist/{members.add.handler-DSRCRxsI.mjs → members.add.handler-CBjoA6vG.mjs} +6 -5
- package/dist/{members.invite.handler-BNpHn1dY.mjs → members.invite.handler-D8KcKJ9Y.mjs} +6 -5
- package/dist/{members.list.handler-Bn9LJEPG.mjs → members.list.handler-CB_qSJK0.mjs} +6 -5
- package/dist/{members.remove.handler-Dkr2t_tX.mjs → members.remove.handler-DNhO81mo.mjs} +6 -5
- package/dist/{members.update.handler-DBtUYuAY.mjs → members.update.handler-Bjdk_uz4.mjs} +6 -5
- package/dist/{operations-CF2nUiBs.mjs → operations-HHwoArwE.mjs} +5 -5
- package/dist/org-context-CNh2p2DP.mjs +112 -0
- package/dist/{org-DOH7YHk2.mjs → org-f-qo68Em.mjs} +35 -28
- package/dist/org-output-BcI17Uan.mjs +64 -0
- package/dist/{orgs.create.handler-BO70zIdp.mjs → orgs.create.handler-DOE9ZIed.mjs} +4 -4
- package/dist/{orgs.get.handler-BuGg5bc9.mjs → orgs.get.handler-sWErVI7r.mjs} +4 -4
- package/dist/{orgs.list.handler--5HutMkl.mjs → orgs.list.handler-Cp-mXsA0.mjs} +4 -4
- package/dist/{output-BWcVRt-T.mjs → output-BPydP5tG.mjs} +1 -1
- package/dist/{package-manager-CvY4IW7X.mjs → package-manager-BwJ6muas.mjs} +27 -2
- package/dist/{paused.handler-DHvxz-cC.mjs → paused.handler-DWdoKYY8.mjs} +20 -33
- package/dist/{projects-C5GZ5Jrf.mjs → projects-CCC36zbJ.mjs} +11 -9
- package/dist/{register.handler-CKMZ2WmD.mjs → register.handler-Dxae5iq8.mjs} +3 -3
- package/dist/{render-credential-Bn15FEUC.mjs → render-credential-D-H1ECDt.mjs} +1 -1
- package/dist/{render-operation-DWbMwhfc.mjs → render-operation-iF7Wblv2.mjs} +2 -2
- package/dist/{requirements.handler-B5rqCjMu.mjs → requirements.handler-Bg3mRnER.mjs} +7 -7
- package/dist/{resolve-cli-credentials-CAOSVMJP.mjs → resolve-cli-credentials-GVOOedoQ.mjs} +1 -1
- package/dist/{resolve-project-E9mrh_el.mjs → resolve-project-CoCN9xfi.mjs} +24 -8
- package/dist/{run-polling-DawiBus-.mjs → run-polling-htHWhG0T.mjs} +97 -14
- package/dist/{run.handler-BG7xitEK.mjs → run.handler-C-CM-xZG.mjs} +42 -30
- package/dist/{runs-swYYBT6C.mjs → runs-BRJPNq4B.mjs} +4 -4
- package/dist/{schema-display-FvI8QjOQ.mjs → schema-display-sZ6ConJd.mjs} +33 -26
- package/dist/schemas-ClAIoIrX.mjs +281 -0
- package/dist/{search-CA0J5NOY.mjs → search-CQMgdp51.mjs} +3 -3
- package/dist/{search.handler-BVDsYZlJ.mjs → search.handler-Dn5jjyF-.mjs} +6 -6
- package/dist/show.handler-CdZF0aao.mjs +79 -0
- package/dist/{show.handler-CsidInW8.mjs → show.handler-D3nDc1MJ.mjs} +5 -5
- package/dist/{show.handler-CwwnCmbp.mjs → show.handler-DUDxnNiZ.mjs} +6 -6
- package/dist/{skill-installer-DG8kTaQR.mjs → skill-installer-DYNH_MJT.mjs} +3 -1
- package/dist/{skills-sync.handler-yRmi3OgP.mjs → skills-sync.handler-_LVhIMRH.mjs} +13 -7
- package/dist/{skills.command-COYd3k4Z.mjs → skills.command-DSHGwXPX.mjs} +5 -5
- package/dist/skills.handler-DqLXJepA.mjs +9 -0
- package/dist/{spinner-progress-lrKDs4YF.mjs → spinner-progress-fLaD0sjH.mjs} +1 -1
- package/dist/status.handler-1hEzX5oB.mjs +72 -0
- package/dist/{switch.handler-BwYndsP-.mjs → switch.handler-D135WwfB.mjs} +17 -4
- package/dist/{sync-6fZkIUtn.mjs → sync-CFScllh3.mjs} +2 -2
- package/dist/{sync.handler-Ctr-cN9X.mjs → sync.handler-x8v53-TT.mjs} +8 -8
- package/dist/{task-BWuIKWh4.mjs → task-DTvLzUkA.mjs} +2 -88
- package/dist/{task-target-build-QllcCfoN.mjs → task-target-build-CtvRyVjH.mjs} +5 -5
- package/dist/task-target-deploy-runner.mjs +6 -6
- package/dist/{test-C8VIZe9V.mjs → test-Dx4RXoLZ.mjs} +5 -5
- package/dist/{test.handler-DLaxrJ9V.mjs → test.handler-BmvL5vF8.mjs} +19 -16
- package/dist/{test.handler-BCW0YBPd.mjs → test.handler-Mz_XOnJl.mjs} +2 -2
- package/dist/{tool.handler-8qNmgdRe.mjs → tool.handler-DsbpocYI.mjs} +12 -12
- package/dist/{trigger-artifacts-BcRScRSp-BiD2h6do.mjs → trigger-artifacts-BcRScRSp-BRpU-He5.mjs} +2 -2
- package/dist/{trigger-manifest-C07EM-b2.mjs → trigger-manifest-BVqjDhxU.mjs} +1 -1
- package/dist/{upgrade-DgOcc8IT.mjs → upgrade-C9G6HksL.mjs} +4 -8
- package/dist/upgrade.handler-DsFeAFF4.mjs +99 -0
- package/dist/{upload.handler-B7xle1oX.mjs → upload.handler-DscKDQ63.mjs} +9 -9
- package/dist/{users.get.handler-C4t1vXwi.mjs → users.get.handler-CaUv_maM.mjs} +4 -4
- package/dist/{users.list.handler-Dvl90grq.mjs → users.list.handler-DzsOvAtd.mjs} +4 -4
- package/dist/{users.set-role.handler-Djw1_VGf.mjs → users.set-role.handler-koRzA0V9.mjs} +4 -4
- package/dist/{validate.handler-Drf_lssw.mjs → validate.handler-BkBsS8BL.mjs} +171 -26
- package/dist/{workflow-build-Begvjfq8.mjs → workflow-build-Db6at6IA.mjs} +234 -32
- package/dist/{workflow-build-manifest-1sC52TIG.mjs → workflow-build-manifest-CV6bBmDO.mjs} +1 -1
- package/dist/{workflow-bundler-BzHk73PM-muPv1yGG.mjs → workflow-bundler-Bs3zQNQv-Dy7lXxy3.mjs} +15 -4
- package/dist/{workflows-DjMlxuBX.mjs → workflows-B8VG6nKg.mjs} +34 -37
- package/dist/{writer-byNNUjRm-B-on1n6c.mjs → writer-BLg0RuZa-Y6ExdYH9.mjs} +6 -4
- package/package.json +10 -10
- package/dist/current-deployment-workflow-B1VQCYC-.mjs +0 -94
- package/dist/current.handler-BaGaCLzB.mjs +0 -21
- package/dist/list.handler-BEMj3FyH.mjs +0 -76
- package/dist/list.handler-Cq_oQY5B.mjs +0 -52
- package/dist/list.handler-htR9TeiS.mjs +0 -24
- package/dist/schemas-D2zfmyC-.mjs +0 -671
- package/dist/show.handler-nkK6Erbb.mjs +0 -31
- package/dist/skills.handler-DYIQK0Vu.mjs +0 -9
- package/dist/status.handler-Ch_DtyBp.mjs +0 -109
- package/dist/upgrade.handler-DSZuw7-9.mjs +0 -80
- /package/dist/{build-metadata-BB_L45ZS-DSJL7dTy.mjs → build-metadata-BB_L45ZS-DRQsV6JK.mjs} +0 -0
- /package/dist/{deploy-DhCbYFc7.mjs → deploy-BiKBH25R.mjs} +0 -0
- /package/dist/{detect-env-access-CwkOYeYM-COq4U-4Y.mjs → detect-env-access-CwkOYeYM-r4aynBU0.mjs} +0 -0
- /package/dist/{read-credential-keys-77a91T8M-DGK5XTQp.mjs → read-credential-keys-77a91T8M-I07NYwfH.mjs} +0 -0
- /package/dist/{run-polling-fBouPjJ2.mjs → run-polling-1c0ckC1A.mjs} +0 -0
- /package/dist/{schemas-4Mq_bxob.mjs → schemas-8nhXlXWh.mjs} +0 -0
- /package/dist/{task-target-deploy-B_3HPSo2.mjs → task-target-deploy-m9LfE488.mjs} +0 -0
- /package/dist/{types-AlA-ifK9.mjs → types-Cb0eWmUU.mjs} +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { P as throwReportedCliExit, n as style, p as ui, t as ANSI } from "./keystroke.mjs";
|
|
4
|
+
import { i as projects } from "./dist-B5jy238v.mjs";
|
|
5
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
6
|
+
import { t as requireWorkflowsDir } from "./resolve-project-CoCN9xfi.mjs";
|
|
7
|
+
import { t as createSpinnerProgress } from "./spinner-progress-fLaD0sjH.mjs";
|
|
8
|
+
import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-Db6at6IA.mjs";
|
|
9
|
+
import { i as formatWorkflowInputFlag, t as formatExampleInputJson } from "./schema-display-sZ6ConJd.mjs";
|
|
10
|
+
//#region src/commands/workflows/list.handler.ts
|
|
11
|
+
function workflowListJsonEntry(artifact) {
|
|
12
|
+
const authoredWorkflowId = artifact.manifest.id;
|
|
13
|
+
return {
|
|
14
|
+
name: artifact.manifest.name,
|
|
15
|
+
id: authoredWorkflowId ?? null,
|
|
16
|
+
filePath: artifact.workflow.resolvedFilePath,
|
|
17
|
+
description: artifact.manifest.description ?? null,
|
|
18
|
+
exportName: artifact.workflow.exportName,
|
|
19
|
+
exampleInput: authoredWorkflowId ? formatExampleInputJson(artifact.manifest.workflowSchemas?.input) : null
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function formatWorkflow(artifact) {
|
|
23
|
+
const name = style(artifact.manifest.name, `${ANSI.bold}${ANSI.cyan}`);
|
|
24
|
+
const filePath = style(artifact.workflow.resolvedFilePath, ANSI.dim);
|
|
25
|
+
const lines = [` ${name}`, ` ${filePath}`];
|
|
26
|
+
if (artifact.manifest.id) lines.push(` ${style(`id: ${artifact.manifest.id}`, ANSI.dim)}`);
|
|
27
|
+
if (artifact.manifest.description) lines.push(` ${artifact.manifest.description}`);
|
|
28
|
+
if (artifact.manifest.id) {
|
|
29
|
+
const inputFlag = formatWorkflowInputFlag(artifact.manifest.workflowSchemas?.input);
|
|
30
|
+
lines.push(` ${style(`$ keystroke workflows test ${artifact.manifest.id} ${inputFlag}`, ANSI.dim)}`);
|
|
31
|
+
lines.push(` ${style(`$ keystroke workflows run ${artifact.manifest.id} ${inputFlag}`, ANSI.dim)}`);
|
|
32
|
+
}
|
|
33
|
+
return lines.join("\n");
|
|
34
|
+
}
|
|
35
|
+
async function handleWorkflowsList(options, ctx) {
|
|
36
|
+
const workflowsDir = await requireWorkflowsDir(options.path);
|
|
37
|
+
await projects.track(workflowsDir);
|
|
38
|
+
const spinner = !ctx.jsonMode ? createSpinnerProgress("[list]") : void 0;
|
|
39
|
+
spinner?.start("Loading workflows...");
|
|
40
|
+
try {
|
|
41
|
+
const { result } = await runWorkflowBuild({
|
|
42
|
+
workflowsDir,
|
|
43
|
+
verbose: false
|
|
44
|
+
});
|
|
45
|
+
spinner?.stop();
|
|
46
|
+
if (ctx.jsonMode) {
|
|
47
|
+
writeJson(result.artifacts.map(workflowListJsonEntry));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (result.artifacts.length === 0) {
|
|
51
|
+
ui.hint(`No workflows found in ${workflowsDir}`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
ui.text(result.artifacts.map(formatWorkflow).join("\n\n"));
|
|
55
|
+
ui.br();
|
|
56
|
+
ui.hint(`${result.artifacts.length} workflow(s) found`);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
spinner?.stop();
|
|
59
|
+
renderBuildFailure(error);
|
|
60
|
+
throwReportedCliExit("Failed to list workflows.", { cause: error });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { handleWorkflowsList };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
5
|
+
import { c as resolveEffectiveOrganization, l as resolveListActiveOrganizationId, o as requireEffectiveOrganization, r as buildOrgListRows, u as warnUnknownOrganizationOverride } from "./org-context-CNh2p2DP.mjs";
|
|
6
|
+
import { i as renderOrgListJson, r as renderOrgListHuman } from "./org-output-BcI17Uan.mjs";
|
|
7
|
+
//#region src/commands/org/list.handler.ts
|
|
8
|
+
async function handleOrgList(_options, ctx) {
|
|
9
|
+
const { user } = await requireClient(ctx).users.getMe();
|
|
10
|
+
const memberships = user.organizations ?? [];
|
|
11
|
+
const storedOrgIds = new Set(ctx.storedOrgs.map((org) => org.organizationId));
|
|
12
|
+
if (!ctx.jsonMode && ctx.organizationId && (ctx.orgSource === "flag" || ctx.orgSource === "env")) warnUnknownOrganizationOverride({
|
|
13
|
+
organizationId: ctx.organizationId,
|
|
14
|
+
orgSource: ctx.orgSource,
|
|
15
|
+
memberships
|
|
16
|
+
});
|
|
17
|
+
const effective = await resolveEffectiveOrganization(ctx, memberships);
|
|
18
|
+
if (ctx.jsonMode && effective && !effective.isMembershipKnown) requireEffectiveOrganization(effective, ctx);
|
|
19
|
+
const activeOrganizationId = resolveListActiveOrganizationId(effective);
|
|
20
|
+
const rows = buildOrgListRows({
|
|
21
|
+
memberships,
|
|
22
|
+
activeOrganizationId,
|
|
23
|
+
storedOrgIds
|
|
24
|
+
});
|
|
25
|
+
if (ctx.jsonMode) {
|
|
26
|
+
renderOrgListJson({
|
|
27
|
+
rows,
|
|
28
|
+
activeOrganizationId: activeOrganizationId ?? null
|
|
29
|
+
});
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (memberships.length === 0) {
|
|
33
|
+
ui.warn("You do not belong to any organization.");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
renderOrgListHuman(rows);
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { handleOrgList };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import { a as readManifestsFromOutDir } from "./dist-
|
|
7
|
-
import { n as resolveWorkflowsDir } from "./resolve-project-
|
|
8
|
-
import { t as readCredentialEnvMap } from "./credential-env-map-
|
|
9
|
-
import { a as loadProjectDotenvFile, i as enrichServerCredentialRow, l as renderCredentialListBlocks, n as buildSyntheticNotOnServerRows, r as collectMergedManifestGroups, t as buildCredentialWorkflowConsumersByGroup } from "./list-enrichment-
|
|
3
|
+
import { P as throwReportedCliExit, c as getProcessEnv, p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { a as readManifestsFromOutDir } from "./dist-BmbFJq8U.mjs";
|
|
7
|
+
import { n as resolveWorkflowsDir } from "./resolve-project-CoCN9xfi.mjs";
|
|
8
|
+
import { t as readCredentialEnvMap } from "./credential-env-map-5a41jLwM.mjs";
|
|
9
|
+
import { a as loadProjectDotenvFile, i as enrichServerCredentialRow, l as renderCredentialListBlocks, n as buildSyntheticNotOnServerRows, r as collectMergedManifestGroups, t as buildCredentialWorkflowConsumersByGroup } from "./list-enrichment-dqbkXJzy.mjs";
|
|
10
10
|
import dayjs from "dayjs";
|
|
11
11
|
//#region src/commands/credentials/list/fetch-all-credential-sets.ts
|
|
12
12
|
/**
|
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import { t as getIntegrationCatalog } from "./integration-catalog-
|
|
3
|
+
import { S as toErrorMessage, n as style, p as ui, t as ANSI, x as isNetworkError } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { t as getIntegrationCatalog } from "./integration-catalog-mZs6EAlN.mjs";
|
|
7
7
|
import Table from "cli-table3";
|
|
8
|
+
//#region ../../packages/shared-types/src/connections/integration-id.ts
|
|
9
|
+
/** Official catalog namespace prefix for integration and connection credential ids. */
|
|
10
|
+
const KEYSTROKE_OFFICIAL_INTEGRATION_PREFIX = "keystroke:";
|
|
11
|
+
/** Legacy bare vendor slugs on operation rows (no `:` or `-` segments). */
|
|
12
|
+
const LEGACY_BARE_INTEGRATION_ID = /^[a-z0-9]+$/;
|
|
13
|
+
/**
|
|
14
|
+
* Returns equivalent integration ids for lookup (catalog `publicId` vs legacy operation rows).
|
|
15
|
+
* Example: `twilio` ↔ `keystroke:twilio`.
|
|
16
|
+
*/
|
|
17
|
+
function expandIntegrationIdVariants(id) {
|
|
18
|
+
const trimmed = id.trim();
|
|
19
|
+
if (!trimmed) return [];
|
|
20
|
+
const variants = new Set([trimmed]);
|
|
21
|
+
if (trimmed.startsWith("keystroke:")) {
|
|
22
|
+
const bare = trimmed.slice(10);
|
|
23
|
+
if (bare) variants.add(bare);
|
|
24
|
+
} else if (LEGACY_BARE_INTEGRATION_ID.test(trimmed)) variants.add(`${KEYSTROKE_OFFICIAL_INTEGRATION_PREFIX}${trimmed}`);
|
|
25
|
+
return [...variants];
|
|
26
|
+
}
|
|
27
|
+
function integrationIdsMatch(left, right) {
|
|
28
|
+
const leftVariants = new Set(expandIntegrationIdVariants(left));
|
|
29
|
+
return expandIntegrationIdVariants(right).some((variant) => leftVariants.has(variant));
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
8
32
|
//#region src/commands/integrations/list.handler.ts
|
|
33
|
+
function connectionBelongsToEntry(connection, entry) {
|
|
34
|
+
const integrationId = connection.integrationPublicId;
|
|
35
|
+
if (integrationId === null) return false;
|
|
36
|
+
return integrationIdsMatch(integrationId, entry.publicId);
|
|
37
|
+
}
|
|
38
|
+
function connectionsForEntry(entry, connections) {
|
|
39
|
+
return connections.filter((connection) => connectionBelongsToEntry(connection, entry));
|
|
40
|
+
}
|
|
9
41
|
function summarizeConnections(entry, connections) {
|
|
10
|
-
const matches =
|
|
42
|
+
const matches = connectionsForEntry(entry, connections);
|
|
11
43
|
if (matches.length === 0) return {
|
|
12
44
|
total: 0,
|
|
13
45
|
defaultStatus: null,
|
|
@@ -23,7 +55,7 @@ function summarizeConnections(entry, connections) {
|
|
|
23
55
|
};
|
|
24
56
|
}
|
|
25
57
|
function formatConnectionStatus(status) {
|
|
26
|
-
return status === "connected" ? style("connected", ANSI.green) : status === "broken" ? style("broken", ANSI.red) : status === "needs_reconnect" ? style("needs reconnect", ANSI.yellow) : status === "disconnected" ? style("disconnected", ANSI.dim) : status
|
|
58
|
+
return status === "connected" ? style("connected", ANSI.green) : status === "broken" ? style("broken", ANSI.red) : status === "needs_reconnect" ? style("needs reconnect", ANSI.yellow) : status === "disconnected" ? style("disconnected", ANSI.dim) : status ?? style("(unknown)", ANSI.dim);
|
|
27
59
|
}
|
|
28
60
|
function pluralizeConnection(count) {
|
|
29
61
|
return `${count} connection${count === 1 ? "" : "s"}`;
|
|
@@ -50,7 +82,7 @@ function formatConnectionLine(connection) {
|
|
|
50
82
|
function renderConnectionDetails(entries, connections) {
|
|
51
83
|
const connectedEntries = entries.map((entry) => ({
|
|
52
84
|
entry,
|
|
53
|
-
connections:
|
|
85
|
+
connections: connectionsForEntry(entry, connections)
|
|
54
86
|
})).filter(({ connections: entryConnections }) => entryConnections.length > 0);
|
|
55
87
|
if (connectedEntries.length === 0) return;
|
|
56
88
|
ui.br();
|
|
@@ -99,14 +131,11 @@ async function handleIntegrationsList(options, ctx) {
|
|
|
99
131
|
});
|
|
100
132
|
}
|
|
101
133
|
const connections = await loadConnectionsOrEmpty(ctx);
|
|
102
|
-
if (options.connected)
|
|
103
|
-
const connectedIds = new Set(connections.map((c) => c.integrationPublicId).filter((id) => id !== null));
|
|
104
|
-
entries = entries.filter((entry) => connectedIds.has(entry.publicId));
|
|
105
|
-
}
|
|
134
|
+
if (options.connected) entries = entries.filter((entry) => connections.some((connection) => connectionBelongsToEntry(connection, entry)));
|
|
106
135
|
if (ctx.jsonMode) {
|
|
107
136
|
writeJson(entries.map((entry) => ({
|
|
108
137
|
...entry,
|
|
109
|
-
orgConnections:
|
|
138
|
+
orgConnections: connectionsForEntry(entry, connections)
|
|
110
139
|
})));
|
|
111
140
|
return;
|
|
112
141
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import {
|
|
7
|
-
import { t as renderOperation } from "./render-operation-
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { r as detectPackageManager } from "./package-manager-BwJ6muas.mjs";
|
|
7
|
+
import { t as renderOperation } from "./render-operation-iF7Wblv2.mjs";
|
|
8
8
|
//#region src/commands/operations/list.handler.ts
|
|
9
9
|
async function handleOperationsList(options, ctx) {
|
|
10
10
|
const result = await requireClient(ctx).operations.list({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import { t as renderCredential } from "./render-credential-
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { t as renderCredential } from "./render-credential-D-H1ECDt.mjs";
|
|
7
7
|
//#region src/commands/credentials/definitions/list.handler.ts
|
|
8
8
|
async function handleCredentialDefinitionsList(options, ctx) {
|
|
9
9
|
const result = await requireClient(ctx).credentials.definitions.list({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import { n as isIamJsonMode, t as handleIamError } from "./iam-command-utils-
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { n as isIamJsonMode, t as handleIamError } from "./iam-command-utils-D01Gw8-M.mjs";
|
|
7
7
|
import Table from "cli-table3";
|
|
8
8
|
//#region src/commands/invites/list.handler.ts
|
|
9
9
|
async function handleInvitesList(_options, ctx) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
3
|
+
import { P as throwReportedCliExit, S as toErrorMessage, n as style, p as ui, t as ANSI } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
6
|
import Table from "cli-table3";
|
|
7
7
|
//#region src/commands/api-keys/list.handler.ts
|
|
8
8
|
async function handleApiKeysList(_options, ctx) {
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { n as style, p as ui, t as ANSI } from "./keystroke.mjs";
|
|
4
|
+
import { i as projects } from "./dist-B5jy238v.mjs";
|
|
5
|
+
import { i as readProjectConfig } from "./project-config-DudGRFPO.mjs";
|
|
6
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
7
|
+
import { access } from "node:fs/promises";
|
|
8
|
+
import Table from "cli-table3";
|
|
9
|
+
//#region src/commands/projects/projects-list.ts
|
|
10
|
+
const EMPTY_PROJECTS_HINT = "No tracked projects. Run `keystroke init` to get started.";
|
|
11
|
+
async function pathExists(projectPath) {
|
|
12
|
+
try {
|
|
13
|
+
await access(projectPath);
|
|
14
|
+
return true;
|
|
15
|
+
} catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function resolveProjectName(entry, exists) {
|
|
20
|
+
if (entry.name) return entry.name;
|
|
21
|
+
if (!exists) return null;
|
|
22
|
+
return (await readProjectConfig(entry.path))?.name ?? null;
|
|
23
|
+
}
|
|
24
|
+
function relativeTime(isoDate) {
|
|
25
|
+
const diff = Date.now() - new Date(isoDate).getTime();
|
|
26
|
+
const seconds = Math.floor(diff / 1e3);
|
|
27
|
+
if (seconds < 60) return `${seconds}s ago`;
|
|
28
|
+
const minutes = Math.floor(seconds / 60);
|
|
29
|
+
if (minutes < 60) return `${minutes}m ago`;
|
|
30
|
+
const hours = Math.floor(minutes / 60);
|
|
31
|
+
if (hours < 24) return `${hours}h ago`;
|
|
32
|
+
return `${Math.floor(hours / 24)}d ago`;
|
|
33
|
+
}
|
|
34
|
+
function sortByLastAccessed(entries) {
|
|
35
|
+
return [...entries].sort((a, b) => new Date(b.lastAccessed).getTime() - new Date(a.lastAccessed).getTime());
|
|
36
|
+
}
|
|
37
|
+
async function buildResolvedProjectList(entries, lastProject) {
|
|
38
|
+
return Promise.all(sortByLastAccessed(entries).map(async (entry) => {
|
|
39
|
+
const exists = await pathExists(entry.path);
|
|
40
|
+
return {
|
|
41
|
+
name: await resolveProjectName(entry, exists),
|
|
42
|
+
path: entry.path,
|
|
43
|
+
lastAccessed: entry.lastAccessed,
|
|
44
|
+
exists,
|
|
45
|
+
isRecent: lastProject === entry.path
|
|
46
|
+
};
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
function toProjectsListJson(entries) {
|
|
50
|
+
return entries.map(({ name, path, lastAccessed, isRecent }) => ({
|
|
51
|
+
name,
|
|
52
|
+
path,
|
|
53
|
+
lastAccessed,
|
|
54
|
+
isRecent
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
function formatProjectsTable(entries) {
|
|
58
|
+
const table = new Table({
|
|
59
|
+
head: [
|
|
60
|
+
"Name",
|
|
61
|
+
"Path",
|
|
62
|
+
"Last Accessed"
|
|
63
|
+
],
|
|
64
|
+
style: { head: [] }
|
|
65
|
+
});
|
|
66
|
+
for (const entry of entries) {
|
|
67
|
+
const nameCol = entry.name ?? style("(unnamed)", ANSI.dim);
|
|
68
|
+
const pathCol = entry.exists ? entry.path : `${entry.path} ${style("(missing)", ANSI.yellow)}`;
|
|
69
|
+
const indicator = entry.isRecent ? ` ${style("(recent)", ANSI.cyan)}` : "";
|
|
70
|
+
table.push([
|
|
71
|
+
nameCol,
|
|
72
|
+
`${pathCol}${indicator}`,
|
|
73
|
+
relativeTime(entry.lastAccessed)
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
return table.toString();
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/commands/projects/list.handler.ts
|
|
80
|
+
async function handleProjectsList(_options, ctx) {
|
|
81
|
+
const [tracked, lastProject] = await Promise.all([projects.list(), projects.getLast()]);
|
|
82
|
+
if (tracked.length === 0) {
|
|
83
|
+
if (ctx.jsonMode) {
|
|
84
|
+
writeJson([]);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
ui.hint(EMPTY_PROJECTS_HINT);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const resolved = await buildResolvedProjectList(tracked, lastProject);
|
|
91
|
+
if (ctx.jsonMode) {
|
|
92
|
+
writeJson(toProjectsListJson(resolved));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
ui.text(formatProjectsTable(resolved));
|
|
96
|
+
ui.hint(`\n${resolved.length} project(s) tracked`);
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { handleProjectsList };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-
|
|
4
|
-
import { t as createTypedCommand } from "./commander-
|
|
3
|
+
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-BPydP5tG.mjs";
|
|
4
|
+
import { t as createTypedCommand } from "./commander-B_8QwPpe.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/commands/listen/listen.command.ts
|
|
7
7
|
const ListenOptionsSchema = JsonOptionSchema.extend({ timeout: z.coerce.number().int().min(1).default(300) });
|
|
@@ -18,7 +18,7 @@ function createListenCommand() {
|
|
|
18
18
|
description: "Listen for one incoming request and print its body",
|
|
19
19
|
schema: ListenOptionsSchema,
|
|
20
20
|
optionsConfig: LISTEN_OPTIONS_CONFIG,
|
|
21
|
-
loadHandler: async () => (await import("./listen.handler-
|
|
21
|
+
loadHandler: async () => (await import("./listen.handler-CfRoaOwu.mjs")).handleListen
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { a as writeJsonError, i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import { n as sleep } from "./run-polling-
|
|
3
|
+
import { A as CliExitError, P as throwReportedCliExit, S as toErrorMessage, n as style, p as ui, t as ANSI } from "./keystroke.mjs";
|
|
4
|
+
import { a as writeJsonError, i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { n as sleep } from "./run-polling-1c0ckC1A.mjs";
|
|
7
7
|
import { spawn } from "node:child_process";
|
|
8
8
|
//#region src/lib/clipboard.ts
|
|
9
9
|
function getClipboardCommands() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { t as createTypedCommand } from "./commander-
|
|
3
|
+
import { t as createTypedCommand } from "./commander-B_8QwPpe.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/commands/logs/logs.command.ts
|
|
6
6
|
const LogsOptionsSchema = z.object({
|
|
@@ -44,13 +44,13 @@ function createLogsCommand() {
|
|
|
44
44
|
description: "Display recent CLI log entries",
|
|
45
45
|
schema: LogsOptionsSchema,
|
|
46
46
|
optionsConfig: LOGS_OPTIONS_CONFIG,
|
|
47
|
-
loadHandler: async () => (await import("./logs.handler-
|
|
47
|
+
loadHandler: async () => (await import("./logs.handler-BIqJ0FED.mjs")).handleLogs,
|
|
48
48
|
subcommands: [createTypedCommand({
|
|
49
49
|
name: "clear",
|
|
50
50
|
description: "Clear the CLI log file",
|
|
51
51
|
schema: z.object({}),
|
|
52
52
|
optionsConfig: {},
|
|
53
|
-
loadHandler: async () => (await import("./clear.handler-
|
|
53
|
+
loadHandler: async () => (await import("./clear.handler-DnjvgyMj.mjs")).handleLogsClear
|
|
54
54
|
})]
|
|
55
55
|
});
|
|
56
56
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { R as originalConsole, j as InputValidationError, n as style, p as ui, t as ANSI, z as readLogEntries } from "./keystroke.mjs";
|
|
4
4
|
//#region src/commands/logs/logs.handler.ts
|
|
5
5
|
const LEVEL_STYLES = {
|
|
6
6
|
debug: ANSI.dim,
|
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import { n as
|
|
3
|
+
import { A as CliExitError, P as throwReportedCliExit, S as toErrorMessage, n as style, p as ui, t as ANSI } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { n as resolveWorkflowsDir } from "./resolve-project-CoCN9xfi.mjs";
|
|
7
|
+
import { n as sleep, t as TERMINAL_STATUSES } from "./run-polling-1c0ckC1A.mjs";
|
|
8
|
+
import { n as assertAuthoredWorkflowId, t as WORKFLOW_ID_COMMANDS } from "./authored-workflow-ref-BRCQgyWl.mjs";
|
|
7
9
|
import Table from "cli-table3";
|
|
8
10
|
//#region src/commands/workflows/_shared/run-query.ts
|
|
9
|
-
async function
|
|
10
|
-
|
|
11
|
-
authoredWorkflowId: options.
|
|
11
|
+
async function listRunsByAuthoredWorkflowId(client, options) {
|
|
12
|
+
return (await client.runs.listRuns({
|
|
13
|
+
authoredWorkflowId: options.authoredWorkflowId,
|
|
12
14
|
status: options.status,
|
|
13
15
|
limit: options.limit
|
|
14
|
-
});
|
|
15
|
-
if (byAuthoredId.runs.length > 0) return {
|
|
16
|
-
kind: "authoredId",
|
|
17
|
-
runs: byAuthoredId.runs
|
|
18
|
-
};
|
|
19
|
-
return {
|
|
20
|
-
kind: "name",
|
|
21
|
-
runs: (await client.runs.listRuns({
|
|
22
|
-
workflowName: options.workflowRef,
|
|
23
|
-
status: options.status,
|
|
24
|
-
limit: options.limit
|
|
25
|
-
})).runs
|
|
26
|
-
};
|
|
16
|
+
})).runs;
|
|
27
17
|
}
|
|
28
18
|
//#endregion
|
|
29
19
|
//#region src/commands/workflows/logs/run-log-display.ts
|
|
@@ -88,12 +78,12 @@ async function handleWorkflowsLogs(options, ctx) {
|
|
|
88
78
|
}
|
|
89
79
|
async function listRecentRuns(client, options, jsonMode) {
|
|
90
80
|
try {
|
|
91
|
-
|
|
92
|
-
|
|
81
|
+
await assertWorkflowIdWhenLocal(options.workflow);
|
|
82
|
+
const runs = await listRunsByAuthoredWorkflowId(client, {
|
|
83
|
+
authoredWorkflowId: options.workflow,
|
|
93
84
|
status: options.status,
|
|
94
85
|
limit: options.limit
|
|
95
86
|
});
|
|
96
|
-
const { runs } = result;
|
|
97
87
|
if (jsonMode) {
|
|
98
88
|
writeJson(runs.map((run) => ({
|
|
99
89
|
id: run.id,
|
|
@@ -130,8 +120,9 @@ async function listRecentRuns(client, options, jsonMode) {
|
|
|
130
120
|
formatDuration(run.createdAt, run.completedAt)
|
|
131
121
|
]);
|
|
132
122
|
ui.text(table.toString());
|
|
133
|
-
ui.hint(
|
|
123
|
+
ui.hint(`${runs.length} run(s) matched workflow id "${options.workflow}". Use --latest to view the newest run's logs, or --run-id <id> to pin a specific run.`);
|
|
134
124
|
} catch (error) {
|
|
125
|
+
if (error instanceof CliExitError && error.reported) throw error;
|
|
135
126
|
const message = toErrorMessage(error);
|
|
136
127
|
ui.error(`Failed to list runs: ${message}`);
|
|
137
128
|
throwReportedCliExit(`Failed to list runs: ${message}`, { cause: error });
|
|
@@ -139,18 +130,19 @@ async function listRecentRuns(client, options, jsonMode) {
|
|
|
139
130
|
}
|
|
140
131
|
async function showLatestRunLogs(client, options, jsonMode) {
|
|
141
132
|
try {
|
|
142
|
-
|
|
143
|
-
|
|
133
|
+
await assertWorkflowIdWhenLocal(options.workflow);
|
|
134
|
+
const latestRun = (await listRunsByAuthoredWorkflowId(client, {
|
|
135
|
+
authoredWorkflowId: options.workflow,
|
|
144
136
|
limit: 1
|
|
145
|
-
});
|
|
146
|
-
const latestRun = result.runs[0];
|
|
137
|
+
}))[0];
|
|
147
138
|
if (!latestRun) {
|
|
148
139
|
ui.hint(`No runs found for workflow "${options.workflow}".`);
|
|
149
140
|
return;
|
|
150
141
|
}
|
|
151
|
-
if (!jsonMode) ui.hint(
|
|
142
|
+
if (!jsonMode) ui.hint(`Showing logs for the latest run of workflow id "${options.workflow}". Use --run-id ${latestRun.id} to pin this run.`);
|
|
152
143
|
await showRunLogs(client, latestRun.id, options, jsonMode);
|
|
153
144
|
} catch (error) {
|
|
145
|
+
if (error instanceof CliExitError && error.reported) throw error;
|
|
154
146
|
const message = toErrorMessage(error);
|
|
155
147
|
ui.error(`Failed to resolve latest run: ${message}`);
|
|
156
148
|
throwReportedCliExit(`Failed to resolve latest run: ${message}`, { cause: error });
|
|
@@ -227,5 +219,10 @@ async function showRunLogs(client, runId, options, jsonMode) {
|
|
|
227
219
|
throwReportedCliExit(`Failed to get run logs: ${message}`, { cause: error });
|
|
228
220
|
}
|
|
229
221
|
}
|
|
222
|
+
async function assertWorkflowIdWhenLocal(authoredWorkflowId) {
|
|
223
|
+
const workflowsDir = await resolveWorkflowsDir(void 0);
|
|
224
|
+
if (!workflowsDir) return;
|
|
225
|
+
await assertAuthoredWorkflowId(authoredWorkflowId, workflowsDir, WORKFLOW_ID_COMMANDS.logs);
|
|
226
|
+
}
|
|
230
227
|
//#endregion
|
|
231
228
|
export { handleWorkflowsLogs };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import {
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { n as isIamJsonMode, r as requireConfirmation, t as handleIamError } from "./iam-command-utils-D01Gw8-M.mjs";
|
|
7
|
+
import { s as requireOrganizationId } from "./org-context-CNh2p2DP.mjs";
|
|
7
8
|
//#region src/commands/org/members.add.handler.ts
|
|
8
9
|
async function handleMembersAdd(options, ctx) {
|
|
9
10
|
const client = requireClient(ctx);
|
|
10
|
-
const organizationId = requireOrganizationId(ctx);
|
|
11
|
+
const organizationId = await requireOrganizationId(ctx);
|
|
11
12
|
if (options.role === "owner") requireConfirmation({
|
|
12
13
|
confirmed: options.confirm,
|
|
13
14
|
message: "Adding an owner grants full organization control.",
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import {
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { n as isIamJsonMode, r as requireConfirmation, t as handleIamError } from "./iam-command-utils-D01Gw8-M.mjs";
|
|
7
|
+
import { s as requireOrganizationId } from "./org-context-CNh2p2DP.mjs";
|
|
7
8
|
//#region src/commands/org/members.invite.handler.ts
|
|
8
9
|
async function handleMembersInvite(options, ctx) {
|
|
9
10
|
const client = requireClient(ctx);
|
|
10
|
-
const organizationId = requireOrganizationId(ctx);
|
|
11
|
+
const organizationId = await requireOrganizationId(ctx);
|
|
11
12
|
if (options.role === "owner") requireConfirmation({
|
|
12
13
|
confirmed: options.confirm,
|
|
13
14
|
message: "Inviting an owner grants full organization control.",
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import {
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { n as isIamJsonMode, t as handleIamError } from "./iam-command-utils-D01Gw8-M.mjs";
|
|
7
|
+
import { s as requireOrganizationId } from "./org-context-CNh2p2DP.mjs";
|
|
7
8
|
import Table from "cli-table3";
|
|
8
9
|
//#region src/commands/org/members.list.handler.ts
|
|
9
10
|
async function handleMembersList(_options, ctx) {
|
|
10
11
|
const client = requireClient(ctx);
|
|
11
|
-
const organizationId = requireOrganizationId(ctx);
|
|
12
|
+
const organizationId = await requireOrganizationId(ctx);
|
|
12
13
|
try {
|
|
13
14
|
const result = await client.organizations.members.list(organizationId);
|
|
14
15
|
if (isIamJsonMode(_options, ctx)) {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import {
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-BPydP5tG.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Brc9VGV9.mjs";
|
|
6
|
+
import { n as isIamJsonMode, r as requireConfirmation, t as handleIamError } from "./iam-command-utils-D01Gw8-M.mjs";
|
|
7
|
+
import { s as requireOrganizationId } from "./org-context-CNh2p2DP.mjs";
|
|
7
8
|
//#region src/commands/org/members.remove.handler.ts
|
|
8
9
|
async function handleMembersRemove(options, ctx) {
|
|
9
10
|
const client = requireClient(ctx);
|
|
10
|
-
const organizationId = requireOrganizationId(ctx);
|
|
11
|
+
const organizationId = await requireOrganizationId(ctx);
|
|
11
12
|
requireConfirmation({
|
|
12
13
|
confirmed: options.confirm,
|
|
13
14
|
message: "Removing a member revokes organization access.",
|