@firestartr/cli 2.11.0-snapshot-ghpages-01 → 2.11.0-snapshot-patch-claims

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.
@@ -6,9 +6,7 @@ export declare class CatalogUserChart extends BaseCatalogChart {
6
6
  kind: string;
7
7
  metadata: {
8
8
  name: string;
9
- annotations: {
10
- [key: string]: string;
11
- };
9
+ annotations: Record<string, string>;
12
10
  };
13
11
  spec: {
14
12
  profile: import("../../claims/base/user").IUserClaimProfile;
@@ -1141,6 +1141,7 @@ declare const schemas: {
1141
1141
  };
1142
1142
  source: {
1143
1143
  type: string;
1144
+ required: string[];
1144
1145
  properties: {
1145
1146
  branch: {
1146
1147
  type: string;
@@ -672,6 +672,7 @@ export declare const GithubSchemas: ({
672
672
  };
673
673
  source: {
674
674
  type: string;
675
+ required: string[];
675
676
  properties: {
676
677
  branch: {
677
678
  type: string;
@@ -22,6 +22,7 @@ declare const _default: {
22
22
  };
23
23
  source: {
24
24
  type: string;
25
+ required: string[];
25
26
  properties: {
26
27
  branch: {
27
28
  type: string;
@@ -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,3 @@
1
+ export declare const PROTECTED_CLAIM_PATHS: string[];
2
+ export declare function isProtectedPath(patchPath: string): boolean;
3
+ export declare function normalizePointer(pointer: string): 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
- isPostPatch?: undefined;
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
  }
@@ -0,0 +1,2 @@
1
+ import { RenderedCrMap } from '../renderer/types';
2
+ export declare function validateNoBackstageAnnotationsInK8sCrs(crs: RenderedCrMap): void;
@@ -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,5 +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 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[]>;
5
7
  export declare function prepareFeature(featureName: string, version: string, repo?: string, owner?: string): Promise<void>;
6
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;
@@ -25,7 +25,8 @@ export interface ExpectedOutput {
25
25
  }
26
26
  export interface RenderTest {
27
27
  name: string;
28
- cr: string;
28
+ cr?: string;
29
+ claim?: string;
29
30
  args?: Record<string, unknown>;
30
31
  }
31
32
  export interface RenderTestsFile {
@@ -60,6 +61,7 @@ export interface RenderContext {
60
61
  export declare function formatAjvErrors(errors: ErrorObject[] | null | undefined): string;
61
62
  declare function loadAndValidateRenderTests(featurePath: string): RenderTestsFile;
62
63
  declare function resolveCrPath(featurePath: string, crRelPath: string): string;
64
+ declare function resolveClaimPath(featurePath: string, claimRelPath: string): string;
63
65
  export declare function listYamlFiles(dir: string): string[];
64
66
  declare function loadYaml<T = unknown>(file: string): T;
65
67
  declare function mkNamedTmp(...names: string[]): Promise<string>;
@@ -72,5 +74,6 @@ declare const _default: {
72
74
  buildExpectedOutput: typeof buildExpectedOutput;
73
75
  loadAndValidateRenderTests: typeof loadAndValidateRenderTests;
74
76
  resolveCrPath: typeof resolveCrPath;
77
+ resolveClaimPath: typeof resolveClaimPath;
75
78
  };
76
79
  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 buildContext(entity: any, args: any, firestartrConfig: any, featureArgs: any): any;
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,13 +20,8 @@ declare const _default: {
20
20
  };
21
21
  patches: {
22
22
  type: string;
23
- patternProperties: {
24
- '^.+$': {
25
- type: string;
26
- items: {
27
- $ref: string;
28
- };
29
- };
23
+ items: {
24
+ $ref: string;
30
25
  };
31
26
  };
32
27
  filesTemplates: {
@@ -129,7 +124,7 @@ declare const _default: {
129
124
  type: string;
130
125
  };
131
126
  value: {
132
- type: string;
127
+ type: string[];
133
128
  };
134
129
  };
135
130
  required: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "2.11.0-snapshot-ghpages-01",
3
+ "version": "2.11.0-snapshot-patch-claims",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",