@firestartr/cli 2.11.0-snapshot-feature-git-traceability-1 → 2.11.0-snapshot-patches-patch-claims-2
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/build/index.js +1340 -911
- package/build/packages/cdk8s_renderer/src/claims/github/repositoryFeature.d.ts +1 -3
- package/build/packages/cdk8s_renderer/src/claims/stitching/errors.d.ts +14 -0
- package/build/packages/cdk8s_renderer/src/claims/stitching/protectedPaths.d.ts +3 -0
- package/build/packages/cdk8s_renderer/src/claims/stitching/stitching.d.ts +19 -0
- package/build/packages/cdk8s_renderer/src/overriders/featureOverride.d.ts +2 -11
- package/build/packages/features_preparer/src/index.d.ts +5 -2
- package/build/packages/features_preparer/src/installer.d.ts +2 -4
- package/build/packages/features_preparer/src/renderer.d.ts +2 -0
- package/build/packages/features_renderer/index.d.ts +4 -1
- package/build/packages/features_renderer/src/auxiliar.d.ts +6 -12
- package/build/packages/features_renderer/src/render.d.ts +2 -1
- package/build/packages/features_renderer/src/schema.d.ts +8 -1
- package/package.json +1 -1
|
@@ -11,14 +11,12 @@ export interface IGithubRepositoryFeatureClaim extends IClaim {
|
|
|
11
11
|
firestartr: IGithubRepositoryFeatureFirestartrClaim;
|
|
12
12
|
claimRepoName: string;
|
|
13
13
|
context: any;
|
|
14
|
+
claimPatches?: Record<string, any[]>;
|
|
14
15
|
feature: {
|
|
15
16
|
name: string;
|
|
16
17
|
version?: string;
|
|
17
18
|
ref?: string;
|
|
18
19
|
repo?: string;
|
|
19
|
-
sha?: string;
|
|
20
|
-
tags?: string[];
|
|
21
|
-
url?: string;
|
|
22
20
|
};
|
|
23
21
|
repositoryTarget: FirestartrGithubRepositoryFeatureSpecRepositoryTarget;
|
|
24
22
|
files: Array<IGithubRepositoryFeatureFileClaim>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type StitchingViolationReason = 'protected-path' | 'overwrite-protected' | 'duplicate-path';
|
|
2
|
+
export interface StitchingViolation {
|
|
3
|
+
feature: string;
|
|
4
|
+
op: string;
|
|
5
|
+
path: string;
|
|
6
|
+
reason: StitchingViolationReason;
|
|
7
|
+
conflictingFeature?: string;
|
|
8
|
+
message: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class StitchingError extends Error {
|
|
11
|
+
violations: StitchingViolation[];
|
|
12
|
+
constructor(violations: StitchingViolation[]);
|
|
13
|
+
}
|
|
14
|
+
export declare function formatStitchingError(error: StitchingError): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface FeaturePatchEnvelope {
|
|
2
|
+
feature: string;
|
|
3
|
+
patches: Array<{
|
|
4
|
+
op: string;
|
|
5
|
+
path: string;
|
|
6
|
+
value?: unknown;
|
|
7
|
+
name?: string;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export declare function MOCK_STITCHING_FEATURES(mock?: (claim: unknown) => Promise<FeaturePatchEnvelope[]>): void;
|
|
11
|
+
export declare function stitchClaim(claimAfterDefaults: unknown, preCollectedEnvelopes?: FeaturePatchEnvelope[]): Promise<unknown>;
|
|
12
|
+
export declare function extractClaimPatches(rendered: {
|
|
13
|
+
patches?: unknown;
|
|
14
|
+
}): Array<{
|
|
15
|
+
op: string;
|
|
16
|
+
path: string;
|
|
17
|
+
value?: unknown;
|
|
18
|
+
name?: string;
|
|
19
|
+
}>;
|
|
@@ -12,7 +12,7 @@ export declare class FeaturesOverrider extends OverriderPatches {
|
|
|
12
12
|
getFeatureConfig(cr: any): any;
|
|
13
13
|
setUpAndRunRenderer(cr: any): any;
|
|
14
14
|
__validate(): Promise<boolean>;
|
|
15
|
-
__patches(claim: any, _previousCR: any): Promise<
|
|
15
|
+
__patches(claim: any, _previousCR: any): Promise<{
|
|
16
16
|
validate(_cr: any): boolean;
|
|
17
17
|
apply(cr: any): Promise<any>;
|
|
18
18
|
identify(): string;
|
|
@@ -20,14 +20,5 @@ export declare class FeaturesOverrider extends OverriderPatches {
|
|
|
20
20
|
applicableProviders: string[];
|
|
21
21
|
};
|
|
22
22
|
post(cr: any): Promise<import("../claims/github/repositoryFeature").IGithubRepositoryFeatureClaim>;
|
|
23
|
-
|
|
24
|
-
} | {
|
|
25
|
-
isPostPatch: boolean;
|
|
26
|
-
validate(): boolean;
|
|
27
|
-
apply(cr: any): Promise<any>;
|
|
28
|
-
identify(): string;
|
|
29
|
-
applicable(): {
|
|
30
|
-
applicableProviders: string[];
|
|
31
|
-
};
|
|
32
|
-
})[]>;
|
|
23
|
+
}[]>;
|
|
33
24
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { getFeatureConfigFromRef, getFeatureConfig, prepareFeature } from './installer';
|
|
2
|
-
import { renderFeature, renderFeatureFromPath } from './renderer';
|
|
1
|
+
import { getFeatureConfigFromRef, getFeatureConfig, getFeaturePatches, getFeaturePatchesFromRef, prepareFeature } from './installer';
|
|
2
|
+
import { renderFeature, renderFeatureFromPath, getFeaturePatchesFromPath } from './renderer';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
renderFeature: typeof renderFeature;
|
|
5
5
|
renderFeatureFromPath: typeof renderFeatureFromPath;
|
|
6
|
+
getFeaturePatches: typeof getFeaturePatches;
|
|
7
|
+
getFeaturePatchesFromRef: typeof getFeaturePatchesFromRef;
|
|
8
|
+
getFeaturePatchesFromPath: typeof getFeaturePatchesFromPath;
|
|
6
9
|
getFeatureConfigFromRef: typeof getFeatureConfigFromRef;
|
|
7
10
|
getFeatureConfig: typeof getFeatureConfig;
|
|
8
11
|
prepareFeature: typeof prepareFeature;
|
|
@@ -2,9 +2,7 @@ export declare function getFeatureConfigFromRef(featureName: string, featureRef:
|
|
|
2
2
|
featureArgs?: any, repo?: string, owner?: string): Promise<any>;
|
|
3
3
|
export declare function getFeatureConfig(featureName: string, version: string, featureOwner: any, // -> cr
|
|
4
4
|
featureArgs?: any, repo?: string, owner?: string): Promise<any>;
|
|
5
|
-
export declare function
|
|
6
|
-
|
|
7
|
-
tags: string[];
|
|
8
|
-
}>;
|
|
5
|
+
export declare function getFeaturePatches(featureName: string, version: string, featureOwner: any, featureArgs?: any, repo?: string, owner?: string): Promise<any[]>;
|
|
6
|
+
export declare function getFeaturePatchesFromRef(featureName: string, featureRef: string, featureOwner: any, featureArgs?: any, repo?: string, owner?: string): Promise<any[]>;
|
|
9
7
|
export declare function prepareFeature(featureName: string, version: string, repo?: string, owner?: string): Promise<void>;
|
|
10
8
|
export declare function downloadFeatureZip(repo: string, featureName: string, reference: string, owner?: string): Promise<string>;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare function renderFeature(featureName: string, version: string, owner: any, repo: any, featureOwner: any, renderPath?: string, featureArgs?: any): any;
|
|
2
2
|
export declare function renderFeatureFromPath(extractPath: string, renderedPath: string, featureOwner: any, featureArgs?: any): any;
|
|
3
|
+
export declare function getFeaturePatches(featureName: string, version: string, owner: any, repo: any, featureOwner: any, featureArgs?: any): any[];
|
|
4
|
+
export declare function getFeaturePatchesFromPath(extractPath: string, featureOwner: any, featureArgs?: any): any[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import validate from './src/validate';
|
|
2
|
-
import render, { buildContext, renderContent, expandFiles } from './src/render';
|
|
2
|
+
import render, { buildContext, renderContent, expandFiles, getPatches } from './src/render';
|
|
3
3
|
import updateFileContent from './src/update_file';
|
|
4
4
|
import { validateFeatureArgs } from './src/featureArgsValidation';
|
|
5
|
+
export { getPatches, buildContext, renderContent, expandFiles };
|
|
5
6
|
declare const _default: {
|
|
6
7
|
validate: typeof validate;
|
|
7
8
|
render: typeof render;
|
|
@@ -12,10 +13,12 @@ declare const _default: {
|
|
|
12
13
|
buildExpectedOutput: (config: import("./src/auxiliar").FeatureConfig, renderDir: string) => import("./src/auxiliar").ExpectedOutput;
|
|
13
14
|
loadAndValidateRenderTests: (featurePath: string) => import("./src/auxiliar").RenderTestsFile;
|
|
14
15
|
resolveCrPath: (featurePath: string, crRelPath: string) => string;
|
|
16
|
+
resolveClaimPath: (featurePath: string, claimRelPath: string) => string;
|
|
15
17
|
};
|
|
16
18
|
buildContext: typeof buildContext;
|
|
17
19
|
renderContent: typeof renderContent;
|
|
18
20
|
expandFiles: typeof expandFiles;
|
|
19
21
|
validateFeatureArgs: typeof validateFeatureArgs;
|
|
22
|
+
getPatches: typeof getPatches;
|
|
20
23
|
};
|
|
21
24
|
export default _default;
|
|
@@ -12,6 +12,7 @@ export interface ConfigFile {
|
|
|
12
12
|
export interface FeatureConfig {
|
|
13
13
|
files?: ConfigFile[];
|
|
14
14
|
patches?: unknown[];
|
|
15
|
+
claimPatches?: Record<string, unknown[]>;
|
|
15
16
|
}
|
|
16
17
|
export interface ExpectedFile {
|
|
17
18
|
localPath: string;
|
|
@@ -19,24 +20,15 @@ export interface ExpectedFile {
|
|
|
19
20
|
targetBranch: string;
|
|
20
21
|
userManaged: boolean;
|
|
21
22
|
}
|
|
22
|
-
export interface Traceability {
|
|
23
|
-
owner?: string;
|
|
24
|
-
repo?: string;
|
|
25
|
-
name?: string;
|
|
26
|
-
version?: string;
|
|
27
|
-
ref?: string;
|
|
28
|
-
url?: string;
|
|
29
|
-
sha?: string;
|
|
30
|
-
tags?: string[];
|
|
31
|
-
}
|
|
32
23
|
export interface ExpectedOutput {
|
|
33
24
|
files: ExpectedFile[];
|
|
34
25
|
patches: unknown[];
|
|
35
|
-
|
|
26
|
+
claimPatches?: Record<string, unknown[]>;
|
|
36
27
|
}
|
|
37
28
|
export interface RenderTest {
|
|
38
29
|
name: string;
|
|
39
|
-
cr
|
|
30
|
+
cr?: string;
|
|
31
|
+
claim?: string;
|
|
40
32
|
args?: Record<string, unknown>;
|
|
41
33
|
}
|
|
42
34
|
export interface RenderTestsFile {
|
|
@@ -71,6 +63,7 @@ export interface RenderContext {
|
|
|
71
63
|
export declare function formatAjvErrors(errors: ErrorObject[] | null | undefined): string;
|
|
72
64
|
declare function loadAndValidateRenderTests(featurePath: string): RenderTestsFile;
|
|
73
65
|
declare function resolveCrPath(featurePath: string, crRelPath: string): string;
|
|
66
|
+
declare function resolveClaimPath(featurePath: string, claimRelPath: string): string;
|
|
74
67
|
export declare function listYamlFiles(dir: string): string[];
|
|
75
68
|
declare function loadYaml<T = unknown>(file: string): T;
|
|
76
69
|
declare function mkNamedTmp(...names: string[]): Promise<string>;
|
|
@@ -83,5 +76,6 @@ declare const _default: {
|
|
|
83
76
|
buildExpectedOutput: typeof buildExpectedOutput;
|
|
84
77
|
loadAndValidateRenderTests: typeof loadAndValidateRenderTests;
|
|
85
78
|
resolveCrPath: typeof resolveCrPath;
|
|
79
|
+
resolveClaimPath: typeof resolveClaimPath;
|
|
86
80
|
};
|
|
87
81
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export default function render(featurePath: string, featureRenderPath: string, entity: any, firestartrConfig?: any, featureArgs?: any): any;
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function getPatches(featurePath: string, entity: any, firestartrConfig?: any, featureArgs?: any): any[];
|
|
3
|
+
export declare function buildContext(stitchedClaim: any, args: any, firestartrConfig: any, featureArgs: any): any;
|
|
3
4
|
export declare function expandFiles(featurePath: string, configData: any, context: any): void;
|
|
4
5
|
export declare function renderContent(template: string, ctx: any): any;
|
|
5
6
|
export declare function assertNonEmptyString(value: unknown, what: string): asserts value is string;
|
|
@@ -20,6 +20,13 @@ declare const _default: {
|
|
|
20
20
|
};
|
|
21
21
|
patches: {
|
|
22
22
|
type: string;
|
|
23
|
+
items: {
|
|
24
|
+
$ref: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
claimPatches: {
|
|
28
|
+
type: string;
|
|
29
|
+
additionalProperties: boolean;
|
|
23
30
|
patternProperties: {
|
|
24
31
|
'^.+$': {
|
|
25
32
|
type: string;
|
|
@@ -129,7 +136,7 @@ declare const _default: {
|
|
|
129
136
|
type: string;
|
|
130
137
|
};
|
|
131
138
|
value: {
|
|
132
|
-
type: string;
|
|
139
|
+
type: string[];
|
|
133
140
|
};
|
|
134
141
|
};
|
|
135
142
|
required: string[];
|