@pipeline-builder/api-core 7.4.5 → 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.
- package/lib/constants/database.d.ts +8 -0
- package/lib/constants/database.js +11 -0
- package/lib/constants/index.d.ts +2 -0
- package/lib/constants/index.js +3 -1
- package/lib/constants/registry.d.ts +8 -0
- package/lib/constants/registry.js +11 -0
- package/lib/types/error-codes.d.ts +12 -1
- package/lib/types/error-codes.js +16 -3
- package/lib/types/pipeline-runners.d.ts +315 -83
- package/lib/types/pipeline-runners.js +211 -89
- package/lib/types/pipeline-source.d.ts +82 -3
- package/lib/types/pipeline-source.js +124 -26
- package/lib/types/remote-audit-actions.d.ts +1 -1
- package/lib/types/remote-audit-actions.js +8 -2
- package/lib/validation/ai-schemas.d.ts +6 -3
- package/lib/validation/ai-schemas.js +14 -6
- package/package.json +1 -1
|
@@ -20,8 +20,14 @@
|
|
|
20
20
|
* And inspect_repository's: which GitHub reads a claim may ask for
|
|
21
21
|
* ({@link repositoryReadProblem}) and what a runner's answer to each may hold
|
|
22
22
|
* ({@link parseRunnerRepositoryReads}, {@link parseRepositoryReadBody}).
|
|
23
|
+
*
|
|
24
|
+
* And the connection inspection's (inspect_connection_start / _status): the
|
|
25
|
+
* build files every analysis reads ({@link REPOSITORY_BUILD_FILES} — the
|
|
26
|
+
* pipeline service's analyzer and the runner's inspect build share the list),
|
|
27
|
+
* the snapshot the build leaves ({@link parseRepositorySnapshot}) and the
|
|
28
|
+
* runner's replies.
|
|
23
29
|
*/
|
|
24
|
-
import { type RepositoryRead, type SourceOptionsUnavailableReason } from './pipeline-runners.js';
|
|
30
|
+
import { type DefaultRunnerSkippedDto, type InspectConnectionFailedPhase, type InspectConnectionState, type RepositoryRead, type SourceOptionsUnavailableReason } from './pipeline-runners.js';
|
|
25
31
|
/**
|
|
26
32
|
* An AWS CodeConnections connection ARN: the current `codeconnections` service
|
|
27
33
|
* prefix or the legacy `codestar-connections` one, any partition.
|
|
@@ -114,7 +120,7 @@ export declare const GIT_PROVIDERS: {
|
|
|
114
120
|
};
|
|
115
121
|
/** Supported Git hosting providers. */
|
|
116
122
|
export type GitProvider = keyof typeof GIT_PROVIDERS;
|
|
117
|
-
/** The provider a hostname names (
|
|
123
|
+
/** The provider a hostname names (case-insensitive, an optional `www.` ignored), else `unknown`. */
|
|
118
124
|
export declare function providerForHost(host: string): GitProvider;
|
|
119
125
|
/** The CodeConnections provider types a pipeline source can read through. */
|
|
120
126
|
export declare const SOURCE_CONNECTION_PROVIDER_TYPES: readonly ['GitHub', 'GitHubEnterpriseServer', 'GitLab', 'GitLabSelfManaged', 'Bitbucket'];
|
|
@@ -122,6 +128,38 @@ export type SourceConnectionProviderType = (typeof SOURCE_CONNECTION_PROVIDER_TY
|
|
|
122
128
|
/** A CodeConnections connection's status: `PENDING` until its handshake is finished in the console. */
|
|
123
129
|
export declare const SOURCE_CONNECTION_STATUSES: readonly ['PENDING', 'AVAILABLE', 'ERROR'];
|
|
124
130
|
export type SourceConnectionStatus = (typeof SOURCE_CONNECTION_STATUSES)[number];
|
|
131
|
+
/**
|
|
132
|
+
* THE CodeConnections provider-type catalog: how each type is shown, the
|
|
133
|
+
* CodeBuild source type a clone through it uses, and the public host it serves
|
|
134
|
+
* (`null` for a self-managed server, reached through a CodeConnections HOST).
|
|
135
|
+
*/
|
|
136
|
+
export declare const SOURCE_CONNECTION_PROVIDERS: {
|
|
137
|
+
readonly GitHub: {
|
|
138
|
+
readonly label: 'GitHub';
|
|
139
|
+
readonly codebuildSourceType: 'GITHUB';
|
|
140
|
+
readonly publicProvider: 'github';
|
|
141
|
+
};
|
|
142
|
+
readonly GitHubEnterpriseServer: {
|
|
143
|
+
readonly label: 'GitHub Enterprise Server';
|
|
144
|
+
readonly codebuildSourceType: 'GITHUB_ENTERPRISE';
|
|
145
|
+
readonly publicProvider: null;
|
|
146
|
+
};
|
|
147
|
+
readonly GitLab: {
|
|
148
|
+
readonly label: 'GitLab';
|
|
149
|
+
readonly codebuildSourceType: 'GITLAB';
|
|
150
|
+
readonly publicProvider: 'gitlab';
|
|
151
|
+
};
|
|
152
|
+
readonly GitLabSelfManaged: {
|
|
153
|
+
readonly label: 'GitLab self-managed';
|
|
154
|
+
readonly codebuildSourceType: 'GITLAB_SELF_MANAGED';
|
|
155
|
+
readonly publicProvider: null;
|
|
156
|
+
};
|
|
157
|
+
readonly Bitbucket: {
|
|
158
|
+
readonly label: 'Bitbucket';
|
|
159
|
+
readonly codebuildSourceType: 'BITBUCKET';
|
|
160
|
+
readonly publicProvider: 'bitbucket';
|
|
161
|
+
};
|
|
162
|
+
};
|
|
125
163
|
/** Where a repository lives: its (lowercased) host, the owner (first path segment) and the `owner/…/repo` path. */
|
|
126
164
|
export interface RepositoryLocation {
|
|
127
165
|
host: string;
|
|
@@ -258,10 +296,11 @@ export type SourceOptionsDto = {
|
|
|
258
296
|
githubToken: GitHubTokenSecretDto | null;
|
|
259
297
|
truncated: boolean;
|
|
260
298
|
lastUsedConnectionArn: string | null;
|
|
299
|
+
/** The org's default connector was passed over for this listing, and why (the picker says so). */
|
|
300
|
+
defaultSkipped: DefaultRunnerSkippedDto | null;
|
|
261
301
|
} | {
|
|
262
302
|
available: false;
|
|
263
303
|
reason: SourceOptionsUnavailableReason;
|
|
264
|
-
updateCommand?: string;
|
|
265
304
|
};
|
|
266
305
|
/**
|
|
267
306
|
* Whether a repository is public, from its host's own flag (GitHub `private` /
|
|
@@ -297,3 +336,43 @@ export declare function parseRunnerRepositoryReads(raw: unknown): RepositoryRead
|
|
|
297
336
|
* most {@link INSPECT_MAX_LISTING_ENTRIES}), or one base64 file.
|
|
298
337
|
*/
|
|
299
338
|
export declare function parseRepositoryReadBody(read: RepositoryRead, body: unknown): unknown;
|
|
339
|
+
/** The files that say how a directory builds, in the order they are read. */
|
|
340
|
+
export declare const REPOSITORY_BUILD_FILES: readonly ['package.json', 'buildspec.yml', 'buildspec.yaml', 'Dockerfile', '.gitlab-ci.yml', 'bitbucket-pipelines.yml'];
|
|
341
|
+
/** The workflows directory GitHub Actions reads. */
|
|
342
|
+
export declare const REPOSITORY_WORKFLOWS_DIR = ".github/workflows";
|
|
343
|
+
/** Most GitHub Actions workflows read. */
|
|
344
|
+
export declare const REPOSITORY_MAX_WORKFLOWS = 3;
|
|
345
|
+
/**
|
|
346
|
+
* What the runner's inspect build collects from a clone — exactly what a
|
|
347
|
+
* repository analysis reads, nothing more: the root, analyzed-directory and
|
|
348
|
+
* workflows listings (`''` = the root), the build/CI files among them (base64),
|
|
349
|
+
* and bytes per language (by file extension). `branch` is the one cloned, null
|
|
350
|
+
* when the build couldn't name it.
|
|
351
|
+
*/
|
|
352
|
+
export interface RepositorySnapshot {
|
|
353
|
+
branch: string | null;
|
|
354
|
+
listings: Record<string, Array<{
|
|
355
|
+
name: string;
|
|
356
|
+
type: 'file' | 'dir';
|
|
357
|
+
}>>;
|
|
358
|
+
files: Record<string, string>;
|
|
359
|
+
languages: Record<string, number>;
|
|
360
|
+
}
|
|
361
|
+
/** The inspect build's snapshot, every part checked and bounded; null for anything else. */
|
|
362
|
+
export declare function parseRepositorySnapshot(raw: unknown): RepositorySnapshot | null;
|
|
363
|
+
/** The runner's `inspection_started` details: the build it started (one of its inspect builds). */
|
|
364
|
+
export declare function parseInspectionStartedReply(raw: unknown): {
|
|
365
|
+
buildId: string;
|
|
366
|
+
} | null;
|
|
367
|
+
/** The runner's `inspection_status` details. */
|
|
368
|
+
export type InspectionStatus = {
|
|
369
|
+
state: Exclude<InspectConnectionState, 'succeeded' | 'failed'>;
|
|
370
|
+
} | {
|
|
371
|
+
state: 'succeeded';
|
|
372
|
+
snapshot: RepositorySnapshot;
|
|
373
|
+
} | {
|
|
374
|
+
state: 'failed';
|
|
375
|
+
failedPhase: InspectConnectionFailedPhase;
|
|
376
|
+
};
|
|
377
|
+
/** An `inspection_status` reply: a snapshot exactly when succeeded, a failed phase exactly when failed; null otherwise. */
|
|
378
|
+
export declare function parseInspectionStatusReply(raw: unknown): InspectionStatus | null;
|