@pipeline-builder/api-core 7.4.6 → 7.4.7

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.
@@ -43,71 +43,104 @@ export type TerminalRunRequestStatus = (typeof TERMINAL_RUN_REQUEST_STATUSES)[nu
43
43
  /** Whether `s` is a terminal request status (false for anything unknown). */
44
44
  export declare function isTerminalRunRequestStatus(s: unknown): s is TerminalRunRequestStatus;
45
45
  /** What a signed request asks the runner to do. */
46
- export declare const RUNNER_ACTIONS: readonly ['start', 'stop', 'probe', 'ping', 'status', 'deploy', 'deploy_status', 'deploy_cancel', 'undeploy', 'list_sources', 'check_source', 'inspect_repository', 'inspect_connection_start', 'inspect_connection_status'];
46
+ export declare const RUNNER_ACTIONS: readonly ['start', 'stop', 'probe', 'ping', 'status', 'deploy', 'deploy_status', 'deploy_cancel', 'undeploy', 'list_sources', 'check_source', 'inspect_repository', 'inspect_connection_start', 'inspect_connection_status', 'inspect_connection_stop'];
47
47
  export type RunnerAction = (typeof RUNNER_ACTIONS)[number];
48
- /** The actions recorded as a run request row (a `ping`, a `status` / `deploy_status` read, a `deploy_cancel` and the source actions never are). */
49
- export declare const RUN_REQUEST_ACTIONS: readonly ["start", "stop", "probe", "deploy", "undeploy"];
50
- export type RunRequestAction = (typeof RUN_REQUEST_ACTIONS)[number];
51
- /** A runner's successful answers (`outcome` of a 200). */
52
- export declare const RUNNER_OUTCOMES: readonly ['started', 'stopped', 'match', 'no_match', 'pong', 'status', 'deploying', 'deploy_status', 'deploy_cancelled', 'undeploying', 'sources', 'source_ok', 'repository_reads', 'inspection_started', 'inspection_status'];
53
- export type RunnerOutcome = (typeof RUNNER_OUTCOMES)[number];
54
- /** The outcome a successful answer to each action must carry. */
55
- export declare const EXPECTED_OUTCOMES: Readonly<Record<RunnerAction, readonly RunnerOutcome[]>>;
56
48
  /**
57
- * What a runner bundle can do beyond start/stop/probe/ping/status. `deploy:1`:
58
- * the stack was set up with `--deploy` (EnableDeploy=true) and the
59
- * bundle speaks deploy, deploy_status, deploy_cancel and undeploy. One
60
- * capability covers undeploy too: it runs the same CodeBuild project.
61
- * `sources:1`: the bundle speaks list_sources and check_source and its role may
62
- * list the account's CodeConnections connections and describe its GitHub token
63
- * secrets — every bundle from this version on, with or without deploys.
64
- * `inspect:1`: the bundle speaks inspect_repository and its role may read the
65
- * org's GitHub token secrets' VALUES (GetSecretValue on
66
- * `pipeline-builder/<any org>/github-token[/<owner>]`) to read a private repository for
67
- * Generate from Git — the token never leaves the account.
68
- * `inspect_connection:1`: the bundle speaks inspect_connection_start /
69
- * inspect_connection_status and its stack has the inspect CodeBuild project and
70
- * results bucket — a repository read through a CodeConnections connection.
71
- * `identity:1`: every reply the bundle sends after verifying a request echoes
72
- * `identity` — the connector id, the request id (`jti`), the AWS account id and
73
- * the connector's name (informational) — so the platform can refuse a reply
74
- * from the wrong connector and pin the connector to one AWS account.
75
- * `events:1`: the stack has EventBridge reporting, and a pong carries its
49
+ * What a runner's STACK was set up with, beyond the baseline every runner
50
+ * speaks (start/stop/probe/ping/status, the source actions, repository
51
+ * inspection with the stored token or through a connection, and the identity
52
+ * echo on every reply). Capabilities reflect per-stack settings only:
53
+ * `deploy:1` — set up with `--deploy` (EnableDeploy=true): the bundle speaks
54
+ * deploy, deploy_status, deploy_cancel and undeploy (one CodeBuild project).
55
+ * `events:1` — the stack has EventBridge reporting, and a pong carries its
76
56
  * health (`reporting`: failed events in the dead-letter queue, last event time).
77
57
  */
78
- export declare const RUNNER_CAPABILITIES: readonly ['deploy:1', 'sources:1', 'inspect:1', 'inspect_connection:1', 'identity:1', 'events:1'];
58
+ export declare const RUNNER_CAPABILITIES: readonly ['deploy:1', 'events:1'];
79
59
  export type RunnerCapability = (typeof RUNNER_CAPABILITIES)[number];
80
60
  export declare const DEPLOY_CAPABILITY: "deploy:1";
81
- export declare const SOURCES_CAPABILITY: "sources:1";
82
- export declare const INSPECT_CAPABILITY: "inspect:1";
83
- export declare const INSPECT_CONNECTION_CAPABILITY: "inspect_connection:1";
84
- export declare const IDENTITY_CAPABILITY: "identity:1";
85
61
  export declare const EVENTS_CAPABILITY: "events:1";
62
+ /** A runner's successful answers (`outcome` of a 200). */
63
+ export declare const RUNNER_OUTCOMES: readonly ['started', 'stopped', 'match', 'no_match', 'pong', 'status', 'deploying', 'deploy_status', 'deploy_cancelled', 'undeploying', 'sources', 'source_ok', 'repository_reads', 'inspection_started', 'inspection_status', 'inspection_stopped'];
64
+ export type RunnerOutcome = (typeof RUNNER_OUTCOMES)[number];
86
65
  /**
87
- * The capability each gated action needs. The platform checks it BEFORE
88
- * signing: a bundle without it answers an unknown action 401
89
- * SIGNATURE_INVALID, which would page RunnerSignatureInvalid.
66
+ * THE runner action catalog: every action's outcomes, gating capability and
67
+ * whether it is recorded as a run request. Everything below is derived from it.
90
68
  */
91
- export declare const DEPLOY_ACTION_CAPABILITY: {
92
- readonly deploy: "deploy:1";
93
- readonly deploy_status: "deploy:1";
94
- readonly deploy_cancel: "deploy:1";
95
- readonly undeploy: "deploy:1";
96
- };
97
- /** The source actions' capability (checked before signing, like the deploy actions'). */
98
- export declare const SOURCE_ACTION_CAPABILITY: {
99
- readonly list_sources: "sources:1";
100
- readonly check_source: "sources:1";
101
- };
102
- /** The repository-inspection action's capability. */
103
- export declare const INSPECT_ACTION_CAPABILITY: {
104
- readonly inspect_repository: "inspect:1";
105
- };
106
- /** The connection-inspection actions' capability. */
107
- export declare const INSPECT_CONNECTION_ACTION_CAPABILITY: {
108
- readonly inspect_connection_start: "inspect_connection:1";
109
- readonly inspect_connection_status: "inspect_connection:1";
69
+ export declare const RUNNER_ACTION_SPECS: {
70
+ readonly start: {
71
+ readonly outcomes: readonly ["started"];
72
+ readonly runRequest: true;
73
+ };
74
+ readonly stop: {
75
+ readonly outcomes: readonly ["stopped"];
76
+ readonly runRequest: true;
77
+ };
78
+ readonly probe: {
79
+ readonly outcomes: readonly ["match", "no_match"];
80
+ readonly runRequest: true;
81
+ };
82
+ readonly ping: {
83
+ readonly outcomes: readonly ["pong"];
84
+ };
85
+ readonly status: {
86
+ readonly outcomes: readonly ["status"];
87
+ };
88
+ readonly deploy: {
89
+ readonly outcomes: readonly ["deploying"];
90
+ readonly capability: "deploy:1";
91
+ readonly runRequest: true;
92
+ };
93
+ readonly deploy_status: {
94
+ readonly outcomes: readonly ["deploy_status"];
95
+ readonly capability: "deploy:1";
96
+ };
97
+ readonly deploy_cancel: {
98
+ readonly outcomes: readonly ["deploy_cancelled"];
99
+ readonly capability: "deploy:1";
100
+ };
101
+ readonly undeploy: {
102
+ readonly outcomes: readonly ["undeploying"];
103
+ readonly capability: "deploy:1";
104
+ readonly runRequest: true;
105
+ };
106
+ readonly list_sources: {
107
+ readonly outcomes: readonly ["sources"];
108
+ };
109
+ readonly check_source: {
110
+ readonly outcomes: readonly ["source_ok"];
111
+ };
112
+ readonly inspect_repository: {
113
+ readonly outcomes: readonly ["repository_reads"];
114
+ };
115
+ readonly inspect_connection_start: {
116
+ readonly outcomes: readonly ["inspection_started"];
117
+ };
118
+ readonly inspect_connection_status: {
119
+ readonly outcomes: readonly ["inspection_status"];
120
+ };
121
+ readonly inspect_connection_stop: {
122
+ readonly outcomes: readonly ["inspection_stopped"];
123
+ };
110
124
  };
125
+ type Specs = typeof RUNNER_ACTION_SPECS;
126
+ /** The actions recorded as a run request row. */
127
+ export type RunRequestAction = {
128
+ [A in RunnerAction]: Specs[A] extends {
129
+ runRequest: true;
130
+ } ? A : never;
131
+ }[RunnerAction];
132
+ export declare const RUN_REQUEST_ACTIONS: readonly RunRequestAction[];
133
+ /** The outcome a successful answer to each action must carry. */
134
+ export declare const EXPECTED_OUTCOMES: Readonly<Record<RunnerAction, readonly RunnerOutcome[]>>;
135
+ /** The deploy actions (deploy, deploy_status, deploy_cancel, undeploy) → `deploy:1`. */
136
+ export declare const DEPLOY_ACTION_CAPABILITY: Readonly<Partial<Record<"check_source" | "deploy" | "deploy_cancel" | "deploy_status" | "inspect_connection_start" | "inspect_connection_status" | "inspect_connection_stop" | "inspect_repository" | "list_sources" | "ping" | "probe" | "start" | "status" | "stop" | "undeploy", "deploy:1" | "events:1">>>;
137
+ /** The source actions — what a runner routes and whose `sources` claim it accepts. */
138
+ export declare const SOURCE_ACTIONS: readonly ["list_sources", "check_source"];
139
+ /**
140
+ * Every connection-inspection action — what a runner routes and whose
141
+ * `inspectConnection` claim it accepts.
142
+ */
143
+ export declare const INSPECT_CONNECTION_ACTIONS: readonly ["inspect_connection_start", "inspect_connection_status", "inspect_connection_stop"];
111
144
  /** Whether a runner reporting `capabilities` may be sent `action`. */
112
145
  export declare function runnerSupportsAction(capabilities: readonly string[], action: RunnerAction): boolean;
113
146
  /** A pong's `capabilities`, kept to the known ones (deduplicated, catalog order); [] for anything malformed. */
@@ -237,8 +270,10 @@ export interface RunnerPongDetails {
237
270
  }
238
271
  /** A 12-digit AWS account id. Stored and shown in plain form (pinning, not secrecy). */
239
272
  export declare const AWS_ACCOUNT_ID_PATTERN: RegExp;
273
+ /** Whether `v` is an ISO-8601 date-time string (`YYYY-MM-DDT…`, parseable) — what a reply's timestamps must be. */
274
+ export declare function isIsoDateTime(v: unknown): v is string;
240
275
  /**
241
- * What an `identity:1` runner echoes in every reply to a request it verified:
276
+ * What a runner echoes in every reply to a request it verified:
242
277
  * its connector id (the request's `aud`), the request id (`jti`), its AWS
243
278
  * account id and its name. The platform refuses a reply whose `runnerId` or
244
279
  * `requestId` is not the request's, and pins the connector to `accountId`.
@@ -367,11 +402,6 @@ export declare const RUNNER_ERRORS: {
367
402
  readonly retryable: false;
368
403
  readonly category: 'platform';
369
404
  };
370
- readonly RUNNER_UPDATE_REQUIRED: {
371
- readonly httpStatus: 409;
372
- readonly retryable: false;
373
- readonly category: 'platform';
374
- };
375
405
  readonly RUNNER_PENDING: {
376
406
  readonly httpStatus: 409;
377
407
  readonly retryable: false;
@@ -645,7 +675,7 @@ export declare const RUNNER_ERRORS: {
645
675
  readonly category: 'runner';
646
676
  };
647
677
  /** Not delivered within the request's lifetime. */
648
- /** A reply whose echoed connector id or request id is not the request's (or an identity:1 reply without one). */
678
+ /** A reply whose echoed connector id, request id or region is not the request's, or a success without the echo. */
649
679
  readonly RUNNER_IDENTITY_MISMATCH: {
650
680
  readonly httpStatus: null;
651
681
  readonly retryable: false;
@@ -750,7 +780,7 @@ export interface RunClaims {
750
780
  sources?: RunSourcesClaim;
751
781
  /** inspect_repository only. */
752
782
  inspect?: RunInspectClaim;
753
- /** inspect_connection_start and inspect_connection_status only. */
783
+ /** inspect_connection_start, _status and _stop only. */
754
784
  inspectConnection?: RunInspectConnectionClaim;
755
785
  /** The connector's current name — informational (logs), never checked by the runner. */
756
786
  name?: string;
@@ -889,6 +919,10 @@ export type RunInspectConnectionClaim = {
889
919
  kind: 'status';
890
920
  region: string;
891
921
  buildId: string;
922
+ } | {
923
+ kind: 'stop';
924
+ region: string;
925
+ buildId: string;
892
926
  };
893
927
  /** The repository a connection inspection clones: its host (lowercased) and its `owner/…/repo` path. */
894
928
  export interface InspectConnectionRepository {
@@ -923,10 +957,9 @@ export declare const INSPECT_BUILD_ID_PATTERN: RegExp;
923
957
  * - `no_runner`: no runner can do it;
924
958
  * - `runner_choice_required`: several can and none was named or is the obvious
925
959
  * default — choose one (not `no_runner`, which would send someone to set one up);
926
- * - `runner_update_required` / `runner_unreachable` / `team_deploys_not_shared`
927
- * / `rate_limited`: as named.
960
+ * - `runner_unreachable` / `team_deploys_not_shared` / `rate_limited`: as named.
928
961
  */
929
- export declare const SOURCE_OPTIONS_UNAVAILABLE_REASONS: readonly ['no_runner', 'runner_choice_required', 'runner_update_required', 'runner_unreachable', 'team_deploys_not_shared', 'rate_limited'];
962
+ export declare const SOURCE_OPTIONS_UNAVAILABLE_REASONS: readonly ['no_runner', 'runner_choice_required', 'runner_unreachable', 'team_deploys_not_shared', 'rate_limited'];
930
963
  export type SourceOptionsUnavailableReason = (typeof SOURCE_OPTIONS_UNAVAILABLE_REASONS)[number];
931
964
  /**
932
965
  * A signing key's lifecycle (`pipeline_runner_signing_keys.state`):
@@ -1373,12 +1406,6 @@ export interface DeployLogHint {
1373
1406
  export declare function deployLogHint(runnerId: string, buildId: string | null): DeployLogHint;
1374
1407
  /** The command that turns deploys on for a runner. */
1375
1408
  export declare const DEPLOY_SETUP_COMMAND = "pipeline-manager infra setup-account --deploy";
1376
- /**
1377
- * The command that updates a runner without deploys to the current bundle and
1378
- * role (`sources:1` and its read-only grants). A runner WITH deploys is updated
1379
- * with {@link DEPLOY_SETUP_COMMAND}, so the update keeps them on.
1380
- */
1381
- export declare const SOURCES_SETUP_COMMAND = "pipeline-manager infra setup-account";
1382
1409
  /** The facade routes under `/api/pipelines/runner/deploys/:requestId/`. `session` exchanges the grant; the rest take the session token. */
1383
1410
  export declare const DEPLOY_SESSION_LEAVES: readonly ['session', 'pipeline', 'plugin-lookup', 'progress', 'registry', 'result'];
1384
1411
  export type DeploySessionLeaf = (typeof DEPLOY_SESSION_LEAVES)[number];
@@ -1407,8 +1434,29 @@ export interface RunnerDeployCancelledReply {
1407
1434
  export declare const STACK_RETAINED_REASONS: readonly ['no_runner', 'runner_not_deploy_capable', 'toolchain_too_old', 'no_stack', 'undeploy_not_queued'];
1408
1435
  export type StackRetainedReason = (typeof STACK_RETAINED_REASONS)[number];
1409
1436
  /** Why an eligible runner cannot deploy a pipeline (`GET …/deploy-targets`, `details.reason` of RUNNER_NOT_DEPLOYABLE). */
1410
- export declare const DEPLOY_TARGET_REASONS: readonly ['deploy_not_enabled', 'update_required', 'unhealthy', 'prefix_mismatch', 'team_deploys_not_shared', 'region'];
1437
+ export declare const DEPLOY_TARGET_REASONS: readonly ['deploy_not_enabled', 'unhealthy', 'prefix_mismatch', 'team_deploys_not_shared', 'region'];
1411
1438
  export type DeployTargetReason = (typeof DEPLOY_TARGET_REASONS)[number];
1439
+ /**
1440
+ * How a connector was chosen when the caller named none, in precedence order:
1441
+ * the pipeline's last deploy runner, the org's default connector (an explicit
1442
+ * one, or the only eligible connector), the only usable connector, the
1443
+ * caller's last-used one. (`explicit`: the caller named it.)
1444
+ */
1445
+ export declare const RUNNER_PICK_SOURCES: readonly ['explicit', 'pipeline_last_deploy', 'org_default', 'only_usable', 'last_used'];
1446
+ export type RunnerPickSource = (typeof RUNNER_PICK_SOURCES)[number];
1447
+ /** The connector (and region) used when the caller names none, and why. */
1448
+ export interface RunnerPickDto {
1449
+ runnerId: string;
1450
+ /** Its preselected region: the pipeline's last deploy region, the default's home region (when allowed), else its only region; null = choose. */
1451
+ region: string | null;
1452
+ via: RunnerPickSource;
1453
+ }
1454
+ /** The org's default connector could not be used for this choice, and why. */
1455
+ export interface DefaultRunnerSkippedDto {
1456
+ runnerId: string;
1457
+ label: string;
1458
+ reason: DeployTargetReason;
1459
+ }
1412
1460
  /** Metric names the deploy path and its alerts share. */
1413
1461
  export declare const RUNNER_DEPLOY_METRICS: {
1414
1462
  /** Counter `{outcome}`: finished deploys (deployed | failed | expired | cancelled). */
@@ -1520,7 +1568,6 @@ export interface PipelineRunnerDto {
1520
1568
  status: RunnerStatus;
1521
1569
  lastDeliveryAt: string | null;
1522
1570
  createdAt: string;
1523
- updateRequired: boolean;
1524
1571
  /** Absolute: PLATFORM_BASE_URL + {@link runnerJwksPath}(id). */
1525
1572
  jwksUrl: string;
1526
1573
  /** Pipelines linked to this runner (`pipeline_registry.runner_id`). */
@@ -1545,6 +1592,8 @@ export interface PipelineRunnerDto {
1545
1592
  failedEvents: number;
1546
1593
  lastEventAt: string | null;
1547
1594
  } | null;
1595
+ /** The viewing org's default connector (explicitly, or as its only eligible one). */
1596
+ isDefault: boolean;
1548
1597
  }
1549
1598
  /** A parent org's runner shared with this team (signed with the parent's effective key). */
1550
1599
  export interface InheritedPipelineRunnerDto extends PipelineRunnerDto {
@@ -1560,6 +1609,10 @@ export interface PipelineRunnersListDto {
1560
1609
  inherited: InheritedPipelineRunnerDto[];
1561
1610
  /** Null while runners are unavailable. */
1562
1611
  signingKey: RunnerSigningKeyDto | null;
1612
+ /** The org's default connector: its explicit one, else its only eligible connector; null when neither. */
1613
+ defaultRunnerId: string | null;
1614
+ /** The default was set by an admin (false: implicit — the only eligible connector, or none). */
1615
+ defaultExplicit: boolean;
1563
1616
  }
1564
1617
  /** `GET /pipelines/:pipelineId/runner-link` (and the 202 of `POST …/runner-link/refresh`, with `status: 'checking'`). */
1565
1618
  export interface RunnerLinkDto {
@@ -1710,6 +1763,8 @@ export interface DeployTargetRunnerDto {
1710
1763
  reason: DeployTargetReason | null;
1711
1764
  /** The caller's own runner with deploys off (`deploy_not_enabled`): turn them on in the AWS console. */
1712
1765
  enableDeploy: EnableDeployLinkDto | null;
1766
+ /** The org's default connector (explicitly, or as its only eligible one). */
1767
+ isDefault: boolean;
1713
1768
  }
1714
1769
  /** What both deploy-target listings answer: the eligible runners for a pipeline name. */
1715
1770
  export interface DeployTargetsBaseDto {
@@ -1717,14 +1772,15 @@ export interface DeployTargetsBaseDto {
1717
1772
  unavailableReason: RunnersUnavailableReason | null;
1718
1773
  /** Every eligible runner, deployable or not. */
1719
1774
  runners: DeployTargetRunnerDto[];
1720
- /** The runner used when the body names none: set when exactly one is deployable. */
1721
- autoRunnerId: string | null;
1722
1775
  /**
1723
- * The runner the CALLER last deployed through (their most recent deploy
1724
- * request in this org), while it is deployable here: the default of a
1725
- * several-runner choice. Null otherwise.
1776
+ * The runner (and region) a deploy that names none uses — the pipeline's
1777
+ * last deploy runner, the org default, the only deployable runner, or the
1778
+ * caller's last-used one, first that can deploy it ({@link RUNNER_PICK_SOURCES});
1779
+ * null: several can and none is the obvious one (choose).
1726
1780
  */
1727
- lastUsedRunnerId: string | null;
1781
+ preferred: RunnerPickDto | null;
1782
+ /** The org's default connector exists but can't deploy this pipeline (the picker says why). */
1783
+ defaultSkipped: DefaultRunnerSkippedDto | null;
1728
1784
  /** {@link DEPLOY_SETUP_COMMAND}, for the "no deployable runner" copy. */
1729
1785
  setupCommand: string;
1730
1786
  }