@bussolabs/closeyourit-cli 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,19 +44,19 @@ CLOSEYOURIT_TOKEN=cyi_u_… CLOSEYOURIT_API_URL=https://www.closeyour.it \
44
44
  | `whoami` | Show account, organization, token prefix and permissions. |
45
45
  | `projects list [--page]` | List visible projects. |
46
46
  | `projects show <id\|key>` | Show one project, plus its declared environments and per-environment capabilities. |
47
- | `projects create <name> --key <key> [--group <id\|name>] [--color] [--description] [--roadmap-enabled] [--quick-bug-report-enabled]` | Create a project (optionally inside a group). |
48
- | `projects update --project <id\|key> [--name] [--key] [--color] [--description] [--group] [--roadmap-enabled] [--quick-bug-report-enabled]` | Update a project (only the passed fields change). |
47
+ | `projects create <name> --key <key> [--group <id\|name>] [--color] [--description] [--quick-bug-report-enabled]` | Create a project (optionally inside a group). |
48
+ | `projects update --project <id\|key> [--name] [--key] [--color] [--description] [--group] [--quick-bug-report-enabled]` | Update a project (only the passed fields change). |
49
49
  | `projects link-server --project <id\|key> --host-id <id> --environment-id <id>` | Link a server host to a declared project environment (uptime). |
50
50
  | `projects unlink-server <link-id> --project <id\|key> --confirm` | Unlink a server host from the project. |
51
51
  | `projects settings show --project <id\|key>` | Show a project's settings (log/analytics retention + feature flags). |
52
- | `projects settings update --project <id\|key> [--logs-retention-days] [--analytics-retention-days] [--roadmap-enabled] [--quick-bug-report-enabled] [--analytics-enabled]` | Update a project's settings (only the passed fields change). |
52
+ | `projects settings update --project <id\|key> [--logs-retention-days] [--analytics-retention-days] [--quick-bug-report-enabled] [--analytics-enabled]` | Update a project's settings (only the passed fields change). |
53
53
  | `projects github --project <id\|key>` | Show a project's GitHub integration (repo link + secrets-sync state + tag→release binding rules). |
54
54
  | `projects github-connect --project <id\|key> --repository <owner/name>` | Connect a project to a repository visible to the organization's GitHub App. |
55
55
  | `projects github-map [--connected-only]` | List every visible CloseYourIt project and its connected GitHub repository; automatically fetches all pages. |
56
56
  | `projects github-update --project <id\|key> [--default-branch] [--production-environment-id] [--staging-environment-id] [--sync-enabled] [--sync-secrets] [--tag-binding-enabled] [--autoclose-on-merge]` | Update a project's GitHub binding rules (only the passed fields change; `--sync-secrets`/`--no-sync-secrets` toggles pushing vault secrets to GitHub). |
57
57
  | `groups list [--page]` | List groups (macro-projects) in your org. |
58
- | `groups create <name> [--color] [--roadmap-enabled]` | Create a group (container of related projects, e.g. "DriverOne"). |
59
- | `groups update <id\|name> [--name] [--color] [--roadmap-enabled]` | Update a group (rename, recolor, toggle roadmap). |
58
+ | `groups create <name> [--color]` | Create a group (container of related projects, e.g. "DriverOne"). |
59
+ | `groups update <id\|name> [--name] [--color]` | Update a group (rename, recolor). |
60
60
  | `roles list\|show <id\|name>` | List roles / show a role with its permission keys. |
61
61
  | `roles create <name> [--permission <key>…] [--color]` | Create an RBAC role (bundle of permission keys). |
62
62
  | `roles update <id\|name> [--name] [--permission <key>…] [--color]` | Update a role (permissions REPLACE the set). |
@@ -93,7 +93,7 @@ CLOSEYOURIT_TOKEN=cyi_u_… CLOSEYOURIT_API_URL=https://www.closeyour.it \
93
93
  | `secrets assets shared-list\|shared-upload\|delegate\|undelegate …` | Manage one organization-level ciphertext and delegate it to authorized projects. |
94
94
  | `tickets list --project <id\|key> [--page]` | List tickets. |
95
95
  | `tickets show <id> --project <id\|key>` | Show one ticket. |
96
- | `tickets create --project <id\|key> --title <t> [--kind] [--step-*] [--description] [--status-id] [--priority-id]` | Create a ticket. |
96
+ | `tickets create --project <id\|key> --title <t> [--kind bug\|story\|task\|epic] [--parent-id] [--step-*] [--description] [--status-id] [--priority-id]` | Create a ticket. |
97
97
  | `tickets statuses` | List the org ticket statuses (id, code, label) — the id feeds `create --status-id`. |
98
98
  | `tickets priorities` | List the org ticket priorities (id, code, label) — the id feeds `create --priority-id`. |
99
99
  | `tickets reject <id> --project <id\|key> --reason <text>` | Reject the review: back to work, the reason becomes a comment. |
package/dist/base.d.ts CHANGED
@@ -43,4 +43,15 @@ export declare abstract class BaseCommand extends Command {
43
43
  * swallowed (empty stdout, exit looks like a silent success) for machine consumers (CYCL-1).
44
44
  */
45
45
  protected catch(error: Interfaces.CommandError): Promise<unknown>;
46
+ /**
47
+ * After a successful human-mode command, print the pagination footer once. Every list command
48
+ * renders a single backend page; reading `this.api.lastMeta` (saved by CliApi on the last response)
49
+ * here keeps the "there are more pages" hint in one place instead of in all 30 of them (CYCL-11).
50
+ *
51
+ * Gated on the command actually exposing `--page`: on a download, a lookup, or a `statuses`/`tokens`
52
+ * list without that flag, `lastMeta` may be stale (e.g. left by `resolveProjectId`) or from a
53
+ * collection the reader cannot page, and "Use --page N" would point at a flag that does not exist.
54
+ * Also suppressed on error and in `--json` mode, so machine output stays exact.
55
+ */
56
+ protected finally(err: Error | undefined): Promise<unknown>;
46
57
  }
package/dist/base.js CHANGED
@@ -4,6 +4,7 @@ exports.BaseCommand = exports.pageFlag = exports.environmentFlag = exports.proje
4
4
  const core_1 = require("@oclif/core");
5
5
  const config_1 = require("./lib/config");
6
6
  const api_1 = require("./lib/api");
7
+ const output_1 = require("./lib/output");
7
8
  const error_codes_1 = require("./errors/error-codes");
8
9
  exports.UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
9
10
  /** Shared `--project <id|key>` flag (required). */
@@ -110,5 +111,23 @@ class BaseCommand extends core_1.Command {
110
111
  }
111
112
  return super.catch(error);
112
113
  }
114
+ /**
115
+ * After a successful human-mode command, print the pagination footer once. Every list command
116
+ * renders a single backend page; reading `this.api.lastMeta` (saved by CliApi on the last response)
117
+ * here keeps the "there are more pages" hint in one place instead of in all 30 of them (CYCL-11).
118
+ *
119
+ * Gated on the command actually exposing `--page`: on a download, a lookup, or a `statuses`/`tokens`
120
+ * list without that flag, `lastMeta` may be stale (e.g. left by `resolveProjectId`) or from a
121
+ * collection the reader cannot page, and "Use --page N" would point at a flag that does not exist.
122
+ * Also suppressed on error and in `--json` mode, so machine output stays exact.
123
+ */
124
+ async finally(err) {
125
+ if (!err && !this.jsonEnabled() && 'page' in (this.ctor.flags ?? {})) {
126
+ const footer = (0, output_1.paginationFooter)(this.api?.lastMeta);
127
+ if (footer)
128
+ this.log(footer);
129
+ }
130
+ return super.finally(err);
131
+ }
113
132
  }
114
133
  exports.BaseCommand = BaseCommand;
@@ -7,7 +7,6 @@ export default class GroupsCreate extends BaseCommand {
7
7
  static examples: string[];
8
8
  static flags: {
9
9
  color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
- 'roadmap-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
10
  };
12
11
  run(): Promise<unknown>;
13
12
  }
@@ -11,22 +11,15 @@ class GroupsCreate extends base_1.BaseCommand {
11
11
  static examples = [
12
12
  '<%= config.bin %> groups create DriverOne',
13
13
  '<%= config.bin %> groups create DriverOne --color indigo',
14
- '<%= config.bin %> groups create DriverOne --roadmap-enabled',
15
14
  ];
16
15
  static flags = {
17
16
  color: core_1.Flags.string({ description: 'Color label' }),
18
- 'roadmap-enabled': core_1.Flags.boolean({
19
- allowNo: true,
20
- description: 'Enable the roadmap and cascade it to the projects in this group',
21
- }),
22
17
  };
23
18
  async run() {
24
19
  const { args, flags } = await this.parse(GroupsCreate);
25
20
  const body = { name: args.name };
26
21
  if (flags.color !== undefined)
27
22
  body.color = flags.color;
28
- if (flags['roadmap-enabled'] !== undefined)
29
- body.roadmap_enabled = flags['roadmap-enabled'];
30
23
  const res = await this.api.post('/cli/v1/groups', body);
31
24
  if (!this.jsonEnabled()) {
32
25
  this.log('Group created:');
@@ -8,7 +8,6 @@ export default class GroupsUpdate extends BaseCommand {
8
8
  static flags: {
9
9
  name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
10
  color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
- 'roadmap-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
11
  };
13
12
  run(): Promise<unknown>;
14
13
  }
@@ -7,19 +7,14 @@ class GroupsUpdate extends base_1.BaseCommand {
7
7
  static args = {
8
8
  group: core_1.Args.string({ description: 'Group id (UUID) or name', required: true }),
9
9
  };
10
- static description = 'Update a group (rename, recolor, toggle roadmap)';
10
+ static description = 'Update a group (rename, recolor)';
11
11
  static examples = [
12
12
  '<%= config.bin %> groups update Backend --name "Backend services"',
13
13
  '<%= config.bin %> groups update Backend --color indigo',
14
- '<%= config.bin %> groups update Backend --roadmap-enabled',
15
14
  ];
16
15
  static flags = {
17
16
  name: core_1.Flags.string({ description: 'New name' }),
18
17
  color: core_1.Flags.string({ description: 'Color label' }),
19
- 'roadmap-enabled': core_1.Flags.boolean({
20
- allowNo: true,
21
- description: 'Enable/disable the roadmap and cascade it to the projects in this group',
22
- }),
23
18
  };
24
19
  async run() {
25
20
  const { args, flags } = await this.parse(GroupsUpdate);
@@ -29,8 +24,6 @@ class GroupsUpdate extends base_1.BaseCommand {
29
24
  body.name = flags.name;
30
25
  if (flags.color !== undefined)
31
26
  body.color = flags.color;
32
- if (flags['roadmap-enabled'] !== undefined)
33
- body.roadmap_enabled = flags['roadmap-enabled'];
34
27
  const res = await this.api.put(`/cli/v1/groups/${id}`, body);
35
28
  if (!this.jsonEnabled()) {
36
29
  this.log('Group updated:');
@@ -16,7 +16,7 @@ class IdeasConvert extends base_1.BaseCommand {
16
16
  ...base_1.projectFlag,
17
17
  title: core_1.Flags.string({ description: 'Ticket title (skips AI when set together with --description)' }),
18
18
  description: core_1.Flags.string({ description: 'Ticket description (skips AI when set together with --title)' }),
19
- kind: core_1.Flags.string({ description: 'Ticket kind (default: feature if the project has a roadmap, else bug)' }),
19
+ kind: core_1.Flags.string({ description: 'Ticket kind (default: story)', options: ['bug', 'story', 'task', 'epic'] }),
20
20
  'status-id': core_1.Flags.string({ description: 'Status lookup id (default: open)' }),
21
21
  'priority-id': core_1.Flags.string({ description: 'Priority lookup id (default: medium)' }),
22
22
  };
@@ -10,7 +10,6 @@ export default class ProjectsCreate extends BaseCommand {
10
10
  description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
11
  group: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
12
  key: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
13
- 'roadmap-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
13
  'quick-bug-report-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
14
  };
16
15
  run(): Promise<unknown>;
@@ -12,7 +12,7 @@ class ProjectsCreate extends base_1.BaseCommand {
12
12
  '<%= config.bin %> projects create driverone-rails --key DRRA',
13
13
  '<%= config.bin %> projects create driverone-rails --group DriverOne --key DRRA',
14
14
  '<%= config.bin %> projects create driverone-flutter -g <group-uuid> -k DRFL',
15
- '<%= config.bin %> projects create acme-api -k ACME --roadmap-enabled --quick-bug-report-enabled',
15
+ '<%= config.bin %> projects create acme-api -k ACME --quick-bug-report-enabled',
16
16
  ];
17
17
  static flags = {
18
18
  color: core_1.Flags.string({ description: 'Color label' }),
@@ -23,10 +23,6 @@ class ProjectsCreate extends base_1.BaseCommand {
23
23
  required: true,
24
24
  description: 'Project key (uppercase A-Z0-9, max 4 chars, unique per org)',
25
25
  }),
26
- 'roadmap-enabled': core_1.Flags.boolean({
27
- allowNo: true,
28
- description: 'Enable the roadmap (feature/improvement tickets + milestones) for this project',
29
- }),
30
26
  'quick-bug-report-enabled': core_1.Flags.boolean({
31
27
  allowNo: true,
32
28
  description: 'Enable the AI-assisted quick bug report on this project',
@@ -46,8 +42,6 @@ class ProjectsCreate extends base_1.BaseCommand {
46
42
  else
47
43
  body.group_name = flags.group;
48
44
  }
49
- if (flags['roadmap-enabled'] !== undefined)
50
- body.roadmap_enabled = flags['roadmap-enabled'];
51
45
  if (flags['quick-bug-report-enabled'] !== undefined)
52
46
  body.quick_bug_report_enabled = flags['quick-bug-report-enabled'];
53
47
  const res = await this.api.post('/cli/v1/projects', body);
@@ -5,7 +5,6 @@ export default class ProjectsSettingsUpdate extends BaseCommand {
5
5
  static flags: {
6
6
  'logs-retention-days': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
7
  'analytics-retention-days': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
- 'roadmap-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
8
  'quick-bug-report-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
9
  'analytics-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
10
  project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -8,7 +8,7 @@ class ProjectsSettingsUpdate extends base_1.BaseCommand {
8
8
  static examples = [
9
9
  '<%= config.bin %> projects settings update --project LBRA --logs-retention-days 30',
10
10
  '<%= config.bin %> projects settings update -p LBRA --analytics-retention-days 365 --analytics-enabled',
11
- '<%= config.bin %> projects settings update -p LBRA --roadmap-enabled --no-quick-bug-report-enabled',
11
+ '<%= config.bin %> projects settings update -p LBRA --no-quick-bug-report-enabled',
12
12
  ];
13
13
  static flags = {
14
14
  ...base_1.projectFlag,
@@ -16,7 +16,6 @@ class ProjectsSettingsUpdate extends base_1.BaseCommand {
16
16
  'analytics-retention-days': core_1.Flags.integer({
17
17
  description: 'Analytics retention in days (blank inherits the org/global default)',
18
18
  }),
19
- 'roadmap-enabled': core_1.Flags.boolean({ allowNo: true, description: 'Enable/disable the project roadmap' }),
20
19
  'quick-bug-report-enabled': core_1.Flags.boolean({
21
20
  allowNo: true,
22
21
  description: 'Enable/disable the AI-assisted quick bug report',
@@ -31,8 +30,6 @@ class ProjectsSettingsUpdate extends base_1.BaseCommand {
31
30
  body.logs_retention_days = flags['logs-retention-days'];
32
31
  if (flags['analytics-retention-days'] !== undefined)
33
32
  body.analytics_retention_days = flags['analytics-retention-days'];
34
- if (flags['roadmap-enabled'] !== undefined)
35
- body.roadmap_enabled = flags['roadmap-enabled'];
36
33
  if (flags['quick-bug-report-enabled'] !== undefined)
37
34
  body.quick_bug_report_enabled = flags['quick-bug-report-enabled'];
38
35
  if (flags['analytics-enabled'] !== undefined)
@@ -8,7 +8,6 @@ export default class ProjectsUpdate extends BaseCommand {
8
8
  color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
9
  description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
10
  group: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
- 'roadmap-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
11
  'quick-bug-report-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
12
  project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
14
13
  };
@@ -7,7 +7,7 @@ class ProjectsUpdate extends base_1.BaseCommand {
7
7
  static examples = [
8
8
  '<%= config.bin %> projects update --project LBRA --name "New name"',
9
9
  '<%= config.bin %> projects update -p LBRA --group Backend',
10
- '<%= config.bin %> projects update -p LBRA --roadmap-enabled --no-quick-bug-report-enabled',
10
+ '<%= config.bin %> projects update -p LBRA --no-quick-bug-report-enabled',
11
11
  ];
12
12
  static flags = {
13
13
  ...base_1.projectFlag,
@@ -16,10 +16,6 @@ class ProjectsUpdate extends base_1.BaseCommand {
16
16
  color: core_1.Flags.string({ description: 'Color label' }),
17
17
  description: core_1.Flags.string({ description: 'Free-form description' }),
18
18
  group: core_1.Flags.string({ description: 'Group id (UUID) or name to move the project into' }),
19
- 'roadmap-enabled': core_1.Flags.boolean({
20
- allowNo: true,
21
- description: 'Enable/disable the roadmap (feature/improvement tickets + milestones) for this project',
22
- }),
23
19
  'quick-bug-report-enabled': core_1.Flags.boolean({
24
20
  allowNo: true,
25
21
  description: 'Enable/disable the AI-assisted quick bug report on this project',
@@ -35,8 +31,6 @@ class ProjectsUpdate extends base_1.BaseCommand {
35
31
  }
36
32
  if (flags.group !== undefined)
37
33
  body.group_id = await this.resolveGroupId(flags.group);
38
- if (flags['roadmap-enabled'] !== undefined)
39
- body.roadmap_enabled = flags['roadmap-enabled'];
40
34
  if (flags['quick-bug-report-enabled'] !== undefined)
41
35
  body.quick_bug_report_enabled = flags['quick-bug-report-enabled'];
42
36
  const res = await this.api.put(`/cli/v1/projects/${projectId}`, body);
@@ -17,6 +17,7 @@ export default class TicketsCreate extends BaseCommand {
17
17
  'priority-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
18
  'assignee-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
19
  'milestone-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ 'parent-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
21
  'platform-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
22
  title: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
22
23
  kind: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -14,7 +14,7 @@ class TicketsCreate extends base_1.BaseCommand {
14
14
  static flags = {
15
15
  ...base_1.projectFlag,
16
16
  title: core_1.Flags.string({ description: 'Ticket title', required: true }),
17
- kind: core_1.Flags.string({ description: 'Ticket kind (bug, feature, improvement)', default: 'bug' }),
17
+ kind: core_1.Flags.string({ description: 'Ticket kind (bug, story, task, epic)', default: 'bug', options: ['bug', 'story', 'task', 'epic'] }),
18
18
  ...ticket_body_1.ticketBodyFlags,
19
19
  };
20
20
  async run() {
@@ -20,6 +20,7 @@ export default class TicketsUpdate extends BaseCommand {
20
20
  'priority-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
21
  'assignee-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
22
  'milestone-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
23
+ 'parent-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
23
24
  'platform-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
25
  title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
26
  kind: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -18,7 +18,7 @@ class TicketsUpdate extends base_1.BaseCommand {
18
18
  static flags = {
19
19
  ...base_1.projectFlag,
20
20
  title: core_1.Flags.string({ description: 'Ticket title' }),
21
- kind: core_1.Flags.string({ description: 'Ticket kind (bug, feature, improvement)' }),
21
+ kind: core_1.Flags.string({ description: 'Ticket kind (bug, story, task, epic)', options: ['bug', 'story', 'task', 'epic'] }),
22
22
  ...ticket_body_1.ticketBodyFlags,
23
23
  };
24
24
  async run() {
package/dist/lib/api.d.ts CHANGED
@@ -25,6 +25,13 @@ export interface UploadFile {
25
25
  type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
26
26
  export declare class CliApi {
27
27
  private readonly config;
28
+ /**
29
+ * Meta of the most recent successful response envelope (`{page, per, total, total_pages}`, or
30
+ * undefined for non-paginated responses). `BaseCommand.finally` reads it to print the "there are
31
+ * more pages" footer once per command, instead of threading the envelope through all 30 list
32
+ * commands (CYCL-11). The instance is per-command, so this is that command's last response.
33
+ */
34
+ lastMeta?: Record<string, unknown>;
28
35
  constructor(config: CliConfig);
29
36
  request<T = unknown>(method: HttpMethod, path: string, opts?: RequestOptions): Promise<Envelope<T>>;
30
37
  /**
package/dist/lib/api.js CHANGED
@@ -18,6 +18,13 @@ class ApiRequestError extends Error {
18
18
  exports.ApiRequestError = ApiRequestError;
19
19
  class CliApi {
20
20
  config;
21
+ /**
22
+ * Meta of the most recent successful response envelope (`{page, per, total, total_pages}`, or
23
+ * undefined for non-paginated responses). `BaseCommand.finally` reads it to print the "there are
24
+ * more pages" footer once per command, instead of threading the envelope through all 30 list
25
+ * commands (CYCL-11). The instance is per-command, so this is that command's last response.
26
+ */
27
+ lastMeta;
21
28
  constructor(config) {
22
29
  this.config = config;
23
30
  }
@@ -97,7 +104,9 @@ class CliApi {
97
104
  const error = envelope.error ?? {};
98
105
  throw new ApiRequestError(res.status, error.code ?? `C${res.status}-API-000`, error.message ?? res.statusText ?? `Request failed (${res.status})`, error.details);
99
106
  }
100
- return (json ?? {});
107
+ const envelope = (json ?? {});
108
+ this.lastMeta = envelope.meta;
109
+ return envelope;
101
110
  }
102
111
  get(path, opts) {
103
112
  return this.request('GET', path, opts);
@@ -132,6 +141,10 @@ class CliApi {
132
141
  await this.handleResponse(res); // always throws: maps the JSON error envelope
133
142
  throw new ApiRequestError(res.status, `C${res.status}-API-000`, `Download failed (${res.status})`);
134
143
  }
144
+ // A binary payload is not a paginated collection; clear any meta a prior lookup (e.g.
145
+ // resolveProjectId) left behind so it cannot leak into the pagination footer (CYCL-11). The
146
+ // success path bypasses handleResponse, so this reset must be explicit.
147
+ this.lastMeta = undefined;
135
148
  const data = new Uint8Array(await res.arrayBuffer());
136
149
  const disposition = res.headers.get('content-disposition') ?? '';
137
150
  const match = /filename\*?=(?:UTF-8''|")?([^";]+)/i.exec(disposition);
@@ -15,6 +15,14 @@ export declare function sanitizeMultiline(value: unknown): string;
15
15
  export declare function displayWidth(value: string): number;
16
16
  /** Minimal dependency-free table renderer for human output. */
17
17
  export declare function renderTable(headers: string[], rows: string[][]): string;
18
+ /**
19
+ * Footer line telling the reader that the human table is only one backend page of a larger set:
20
+ * without it, page 1 reads as the whole collection and a 900-ticket project looks like 10 (CYCL-11).
21
+ * Returns undefined when nothing more follows — a single page, the last page, or a collection already
22
+ * aggregated by `fetchAllPages` (whose last saved meta has `page === total_pages`) — so complete
23
+ * output stays clean. Callers gate on `!jsonEnabled()`, so machine output never sees this.
24
+ */
25
+ export declare function paginationFooter(meta: unknown): string | undefined;
18
26
  /**
19
27
  * Status dots make problems scannable at a glance. Four fixed-width circles (no variation
20
28
  * selectors, so table columns stay aligned): down=🔴, warn=🟡, ok=🟢, neutral=⚪.
@@ -4,6 +4,7 @@ exports.sanitize = sanitize;
4
4
  exports.sanitizeMultiline = sanitizeMultiline;
5
5
  exports.displayWidth = displayWidth;
6
6
  exports.renderTable = renderTable;
7
+ exports.paginationFooter = paginationFooter;
7
8
  exports.statusDot = statusDot;
8
9
  exports.statusCell = statusCell;
9
10
  exports.section = section;
@@ -72,6 +73,25 @@ function renderTable(headers, rows) {
72
73
  const separator = widths.map((width) => '-'.repeat(width));
73
74
  return [line(safeHeaders), line(separator), ...safeRows.map(line)].join('\n');
74
75
  }
76
+ /**
77
+ * Footer line telling the reader that the human table is only one backend page of a larger set:
78
+ * without it, page 1 reads as the whole collection and a 900-ticket project looks like 10 (CYCL-11).
79
+ * Returns undefined when nothing more follows — a single page, the last page, or a collection already
80
+ * aggregated by `fetchAllPages` (whose last saved meta has `page === total_pages`) — so complete
81
+ * output stays clean. Callers gate on `!jsonEnabled()`, so machine output never sees this.
82
+ */
83
+ function paginationFooter(meta) {
84
+ if (!meta || typeof meta !== 'object')
85
+ return undefined;
86
+ const { page, total, total_pages: totalPages } = meta;
87
+ const current = Number(page);
88
+ const last = Number(totalPages);
89
+ if (!Number.isInteger(current) || !Number.isInteger(last) || current < 1 || current >= last)
90
+ return undefined;
91
+ const count = Number(total);
92
+ const totalPart = Number.isFinite(count) ? ` — ${count} items total` : '';
93
+ return `Showing page ${current} of ${last}${totalPart}. Use --page ${current + 1} to see more.`;
94
+ }
75
95
  const TONE_DOT = {
76
96
  down: '🔴',
77
97
  neutral: '⚪',
@@ -13,6 +13,7 @@ export declare const ticketBodyFlags: {
13
13
  'priority-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
14
  'assignee-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
15
  'milestone-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ 'parent-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
17
  'platform-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
18
  };
18
19
  type BodyFlags = Record<string, unknown>;
@@ -26,6 +26,7 @@ exports.ticketBodyFlags = {
26
26
  'priority-id': core_1.Flags.string({ description: 'Priority lookup id' }),
27
27
  'assignee-id': core_1.Flags.string({ description: 'Assignee account id' }),
28
28
  'milestone-id': core_1.Flags.string({ description: 'Milestone id (of this project)' }),
29
+ 'parent-id': core_1.Flags.string({ description: 'Parent epic id (of this project) — pass an empty string to detach' }),
29
30
  'platform-id': core_1.Flags.string({ description: 'Affected platform id (repeatable)', multiple: true }),
30
31
  };
31
32
  const STEP_KEYS = [
@@ -80,6 +81,8 @@ function applyTicketBody(body, flags) {
80
81
  body.assignee_id = flags['assignee-id'];
81
82
  if (flags['milestone-id'] !== undefined)
82
83
  body.milestone_id = flags['milestone-id'];
84
+ if (flags['parent-id'] !== undefined)
85
+ body.parent_id = flags['parent-id'];
83
86
  if (flags['platform-id'] !== undefined)
84
87
  body.platform_ids = flags['platform-id'];
85
88
  const scenarios = scenariosFromFlags(flags);