@firestartr/cli 1.46.0 → 1.47.0-snapshot-1

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 CHANGED
@@ -282357,6 +282357,38 @@ async function resolveClaimFileRef(claimFile) {
282357
282357
  throw new Error(`Error: file ${claimFile}: ${err}`);
282358
282358
  }
282359
282359
  }
282360
+ function getClaimsEntryAbsolutePath(claimsDir, entryPath, forbidRelativePath = false) {
282361
+ let realEntryPath = '';
282362
+ if (external_path_default().isAbsolute(entryPath)) {
282363
+ realEntryPath = entryPath;
282364
+ }
282365
+ else {
282366
+ if (forbidRelativePath) {
282367
+ throw new Error('getClaimsEntryAbsolutePath: relatives paths are forbidden');
282368
+ }
282369
+ else {
282370
+ realEntryPath = external_path_default().join(claimsDir, entryPath);
282371
+ }
282372
+ }
282373
+ if (isPathInside(claimsDir, realEntryPath)) {
282374
+ return realEntryPath;
282375
+ }
282376
+ else {
282377
+ throw new Error(`getClaimsEntryAbsolutePath: path ${entryPath} does not belong to ${claimsDir}`);
282378
+ }
282379
+ }
282380
+ function isPathInside(pathA, pathB) {
282381
+ const absolutePathA = external_path_default().resolve(pathA);
282382
+ const absolutePathB = external_path_default().resolve(pathB);
282383
+ const normalizedPathA = external_path_default().normalize(absolutePathA);
282384
+ const normalizedPathB = external_path_default().normalize(absolutePathB);
282385
+ // Ensure pathA ends with a separator to avoid partial matches
282386
+ // e.g., /foo/lol must not match /foo/lollipop
282387
+ const pathAWithSeparator = normalizedPathA.endsWith((external_path_default()).sep)
282388
+ ? normalizedPathA
282389
+ : `${normalizedPathA}${(external_path_default()).sep}`;
282390
+ return normalizedPathB.startsWith(pathAWithSeparator);
282391
+ }
282360
282392
 
282361
282393
  ;// CONCATENATED MODULE: ../cdk8s_renderer/imports/firestartr.dev.ts
282362
282394
  // generated by cdk8s
@@ -285537,8 +285569,8 @@ class SecretsChart extends BaseSecretsChart {
285537
285569
  .concat(pushSecrets)
285538
285570
  .filter((el) => el !== undefined);
285539
285571
  return concatenated.map((chart) => {
285540
- console.log('CHART-TO-JSON');
285541
- console.dir(chart, { depth: null });
285572
+ //console.log('CHART-TO-JSON');
285573
+ //console.dir(chart, { depth: null });
285542
285574
  const cr = chart.toJson();
285543
285575
  return {
285544
285576
  claim: { kind, name: `${name}-${cr.kind}-${cr.metadata.name}` },
@@ -286207,7 +286239,7 @@ async function addLastStateAndLastClaimAnnotations(filePath, lastStatePRLink, la
286207
286239
  * This function returns nothing.
286208
286240
  *
286209
286241
  */
286210
- async function runRenderer(globalsPath, initializersPath, claimsPath, crsPath, claimsDefaults, outputCatalogDir, outputCrDir, renamesEnabled, provider, excludedPaths = [], validateReferentialIntegrity, claimRefs = '', claimFilesList = '') {
286242
+ async function runRenderer(globalsPath, initializersPath, claimsPath, crsPath, claimsDefaults, outputCatalogDir, outputCrDir, renamesEnabled, provider, excludedPaths = [], validateReferentialIntegrity, claimRefs = '', claimFilesList = '', forbidRelativeFileListPaths = false) {
286211
286243
  configureProvider(provider);
286212
286244
  setPath('initializers', initializersPath);
286213
286245
  setPath('crs', crsPath);
@@ -286231,7 +286263,11 @@ async function runRenderer(globalsPath, initializersPath, claimsPath, crsPath, c
286231
286263
  claimRefsList = await claimsRefListAsGenerator(claimRefs.replace(/\s/g, '').split(','));
286232
286264
  }
286233
286265
  else if (claimFilesList) {
286234
- claimRefsList = await resolveClaimEntries(claimFilesList.replace(/\s/g, '').split(','));
286266
+ const claimFilesListPaths = claimFilesList
286267
+ .replace(/\s/g, '')
286268
+ .split(',')
286269
+ .map((entryPath) => getClaimsEntryAbsolutePath(claimsPath, entryPath, forbidRelativeFileListPaths));
286270
+ claimRefsList = await resolveClaimEntries(claimFilesListPaths);
286235
286271
  }
286236
286272
  else {
286237
286273
  // in case nothing is passed
@@ -294387,6 +294423,7 @@ const cdk8s_rendererSubcommands = {
294387
294423
  { name: 'disableRenames', type: Boolean, defaultValue: false },
294388
294424
  { name: 'claimRefsList', type: String, defaultValue: '' },
294389
294425
  { name: 'claimFilesList', type: String, defaultValue: '' },
294426
+ { name: 'forbidRelativeFileListPaths', type: String, defaultValue: false },
294390
294427
  /**
294391
294428
  * Path where the claims defaults are located
294392
294429
  */
@@ -37,4 +37,4 @@ declare const _default: {
37
37
  addLastStateAndLastClaimAnnotations: typeof addLastStateAndLastClaimAnnotations;
38
38
  };
39
39
  export default _default;
40
- export declare function runRenderer(globalsPath: string, initializersPath: string, claimsPath: string, crsPath: string, claimsDefaults: string, outputCatalogDir: string, outputCrDir: string, renamesEnabled: boolean, provider: AllowedProviders, excludedPaths: string[], validateReferentialIntegrity: string, claimRefs?: string, claimFilesList?: string): Promise<void>;
40
+ export declare function runRenderer(globalsPath: string, initializersPath: string, claimsPath: string, crsPath: string, claimsDefaults: string, outputCatalogDir: string, outputCrDir: string, renamesEnabled: boolean, provider: AllowedProviders, excludedPaths: string[], validateReferentialIntegrity: string, claimRefs?: string, claimFilesList?: string, forbidRelativeFileListPaths?: boolean): Promise<void>;
@@ -3,3 +3,4 @@ export declare function claimsRefListAsGenerator(refs: string[]): AsyncGenerator
3
3
  export declare function resolveClaimFilesList(claimRefsList: string): string[];
4
4
  export declare function resolveClaimEntries(claimRefsList: string[]): AsyncGenerator<string, void, unknown>;
5
5
  export declare function resolveClaimFileRef(claimFile: string): Promise<string>;
6
+ export declare function getClaimsEntryAbsolutePath(claimsDir: string, entryPath: string, forbidRelativePath?: boolean): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.46.0",
3
+ "version": "1.47.0-snapshot-1",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",