@firestartr/cli 1.46.0-snapshot-0 → 1.46.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
@@ -262633,8 +262633,8 @@ function sleep(ms) {
262633
262633
  }
262634
262634
 
262635
262635
  // EXTERNAL MODULE: ../../node_modules/lodash/lodash.js
262636
- var lodash = __nccwpck_require__(78018);
262637
- var lodash_default = /*#__PURE__*/__nccwpck_require__.n(lodash);
262636
+ var lodash_lodash = __nccwpck_require__(78018);
262637
+ var lodash_default = /*#__PURE__*/__nccwpck_require__.n(lodash_lodash);
262638
262638
  ;// CONCATENATED MODULE: ../catalog_common/src/generic/name.ts
262639
262639
 
262640
262640
 
@@ -270668,11 +270668,11 @@ class name_NameNormalizer extends Normalizer {
270668
270668
  const provider = helperCTX(this).provider;
270669
270669
  const annotation = catalog_common.generic.getFirestartrAnnotation('external-name');
270670
270670
  const providerName = claim.providers[provider].name;
270671
- if (previousCR && !lodash.isEmpty(previousCR)) {
270671
+ if (previousCR && !lodash_lodash.isEmpty(previousCR)) {
270672
270672
  cr.metadata.annotations[annotation] = providerName;
270673
270673
  cr.metadata.name = previousCR.metadata.name;
270674
270674
  if (previousCR.writeConnectionSecretToRef &&
270675
- !lodash.isEmpty(previousCR.writeConnectionSecretToRef)) {
270675
+ !lodash_lodash.isEmpty(previousCR.writeConnectionSecretToRef)) {
270676
270676
  cr.writeConnectionSecretToRef.name =
270677
270677
  previousCR.writeConnectionSecretToRef.name;
270678
270678
  }
@@ -271481,7 +271481,7 @@ function config_getRenamesEnabled() {
271481
271481
  function setRenamesEnabled(enabled) {
271482
271482
  renamesEnabled = enabled;
271483
271483
  }
271484
- var AllowedProviders;
271484
+ var config_AllowedProviders;
271485
271485
  (function (AllowedProviders) {
271486
271486
  AllowedProviders["all"] = "all";
271487
271487
  AllowedProviders["github"] = "github";
@@ -271490,7 +271490,7 @@ var AllowedProviders;
271490
271490
  AllowedProviders["catalog"] = "catalog";
271491
271491
  AllowedProviders["argocd"] = "argocd";
271492
271492
  AllowedProviders["externalSecrets"] = "externalSecrets";
271493
- })(AllowedProviders || (AllowedProviders = {}));
271493
+ })(config_AllowedProviders || (config_AllowedProviders = {}));
271494
271494
  let configuredProvider = null;
271495
271495
  function configureProvider(provider) {
271496
271496
  if (configuredProvider)
@@ -271511,12 +271511,12 @@ function config_getConfiguredProvider() {
271511
271511
  return configuredProvider;
271512
271512
  }
271513
271513
  const PROVIDER_CLAIM_CR_MAP = {
271514
- [AllowedProviders.github.toString()]: {
271514
+ [config_AllowedProviders.github.toString()]: {
271515
271515
  GroupClaim: 'FirestartrGithubGroup',
271516
271516
  UserClaim: 'FirestartrGithubMembership',
271517
271517
  ComponentClaim: 'FirestartrGithubRepository',
271518
271518
  },
271519
- [AllowedProviders.catalog.toString()]: {
271519
+ [config_AllowedProviders.catalog.toString()]: {
271520
271520
  GroupClaim: 'Group',
271521
271521
  UserClaim: 'User',
271522
271522
  ComponentClaim: 'Component',
@@ -271538,7 +271538,7 @@ function configurePathsForRendering() {
271538
271538
  const configPath = '/tmp/defaults';
271539
271539
  createInitializers(configPath);
271540
271540
  createExpanders(configPath);
271541
- configureProvider(AllowedProviders.all);
271541
+ configureProvider(config_AllowedProviders.all);
271542
271542
  setPath('initializers', configPath);
271543
271543
  setPath('crs', '/tmp/resources_from_main_branch');
271544
271544
  setPath('globals', configPath);
@@ -273722,6 +273722,7 @@ function extractAllRefs(claimData) {
273722
273722
  break;
273723
273723
  }
273724
273724
  }
273725
+ refsExtractor_log(`Refs for ${parsedClaim.kind}-${parsedClaim.name}: ${[...new Set(refs)].join(',')}`);
273725
273726
  return [...new Set(refs)];
273726
273727
  }
273727
273728
  function extractVirtualRefs(parsedClaim) {
@@ -274438,7 +274439,7 @@ function getOrg() {
274438
274439
 
274439
274440
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/wellKnownStructures.ts
274440
274441
 
274441
- function isCollaborator(struc) {
274442
+ function wellKnownStructures_isCollaborator(struc) {
274442
274443
  return hasProperties(struc, ['collaborator', 'role']);
274443
274444
  }
274444
274445
  function hasProperties(struc, properties) {
@@ -274450,7 +274451,7 @@ function hasProperties(struc, properties) {
274450
274451
  return true;
274451
274452
  }
274452
274453
  function hasProperty(struc, property) {
274453
- return lodash_default().has(struc, property);
274454
+ return lodash.has(struc, property);
274454
274455
  }
274455
274456
 
274456
274457
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/references.ts
@@ -274541,7 +274542,7 @@ Check the following Claims to ensure that the tfStateKey is unique:
274541
274542
  */
274542
274543
  function validateReferencesInCR(cr, crs) {
274543
274544
  if (isCatalogEntity(cr)) {
274544
- if (config_getConfiguredProvider() === AllowedProviders.catalog) {
274545
+ if (getConfiguredProvider() === AllowedProviders.catalog) {
274545
274546
  //validateCatalogEntities(cr, crs);
274546
274547
  //console.log(`Skip validation ${cr.name}`);
274547
274548
  }
@@ -274573,7 +274574,7 @@ function throwIfRefNotFoundInCatalog(crs, refObj, refStr, crStr) {
274573
274574
  */
274574
274575
  function validateNonCatalogEntities(cr, crs) {
274575
274576
  for (const rel of references_WELL_KNOWN_RELATIONS[cr.kind] || []) {
274576
- const propertyRef = lodash_default().get(cr, rel);
274577
+ const propertyRef = _.get(cr, rel);
274577
274578
  if (!propertyRef) {
274578
274579
  throw new Error(`CR ${cr.kind} ${cr.metadata.name} does not have property ${rel}`);
274579
274580
  }
@@ -276201,7 +276202,7 @@ async function* resolveClaimEntries(claimRefsList) {
276201
276202
  }
276202
276203
  }
276203
276204
  catch (err) {
276204
- throw `Error processing: ${claimEntry}: ${err}`;
276205
+ throw new Error(`Error processing: ${claimEntry}: ${err}`);
276205
276206
  }
276206
276207
  }
276207
276208
  }
@@ -276213,25 +276214,26 @@ async function* resolveDirEntries(dir) {
276213
276214
  entries = await (0,promises_namespaceObject.readdir)(dir, { withFileTypes: true });
276214
276215
  }
276215
276216
  catch (err) {
276216
- throw `Reading dir: ${dir}: ${err}`;
276217
+ throw new Error(`Reading dir: ${dir}: ${err}`);
276217
276218
  }
276218
276219
  for (const entry of entries) {
276219
276220
  const fullPath = external_path_default().join(dir, entry.name);
276220
- if (entry.isDirectory(fullPath)) {
276221
+ if (entry.isDirectory()) {
276221
276222
  yield* resolveDirEntries(fullPath);
276222
276223
  }
276223
- else if (entry.isFile(fullPath) && entry.name.match(/\.yaml$|\.yml$/)) {
276224
- claimUtils_log(`Sending entry ${resolveClaimFileRef(fullPath)} (${fullPath})`);
276225
- yield resolveClaimFileRef(fullPath);
276224
+ else if (entry.isFile() && entry.name.match(/\.yaml$|\.yml$/)) {
276225
+ const claimRef = await resolveClaimFileRef(fullPath);
276226
+ claimUtils_log(`Sending entry ${claimRef} (${fullPath})`);
276227
+ yield claimRef;
276226
276228
  }
276227
276229
  }
276228
276230
  }
276229
- function resolveClaimFileRef(claimFile) {
276231
+ async function resolveClaimFileRef(claimFile) {
276230
276232
  try {
276231
- const data = external_fs_default().readFileSync(claimFile, 'utf-8');
276233
+ const data = await external_fs_default().promises.readFile(claimFile, 'utf-8');
276232
276234
  const claim = catalog_common.io.fromYaml(data);
276233
276235
  if (!('kind' in claim && 'name' in claim)) {
276234
- throw 'Invalid claim file has not kind and/or name';
276236
+ throw new Error('Invalid claim file has not kind and/or name');
276235
276237
  }
276236
276238
  else {
276237
276239
  const claimRef = `${claim.kind}-${claim.name}`;
@@ -276239,7 +276241,7 @@ function resolveClaimFileRef(claimFile) {
276239
276241
  }
276240
276242
  }
276241
276243
  catch (err) {
276242
- throw `Error: file ${claimFile}: ${err}`;
276244
+ throw new Error(`Error: file ${claimFile}: ${err}`);
276243
276245
  }
276244
276246
  }
276245
276247
 
@@ -279603,7 +279605,7 @@ async function renderClaims(catalogScope, firestartrScope, data) {
279603
279605
  const claim = renderClaims[claimKey].claim;
279604
279606
  const configuredProvider = config_getConfiguredProvider().toString();
279605
279607
  let providers = Object.keys(claim.providers);
279606
- if (configuredProvider !== AllowedProviders.all.toString()) {
279608
+ if (configuredProvider !== config_AllowedProviders.all.toString()) {
279607
279609
  providers = providers.filter((provider) => provider === configuredProvider);
279608
279610
  }
279609
279611
  const previousCR = getPreviousCRfromClaim(claim, crs);
@@ -279651,11 +279653,11 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
279651
279653
  const renderPatches = patches.filter((patch) => !patch.isPostPatch);
279652
279654
  const postPatches = patches.filter((patch) => patch.isPostPatch);
279653
279655
  const provider = config_getConfiguredProvider();
279654
- const loadGithub = (provider === AllowedProviders.all ||
279655
- provider === AllowedProviders.catalog ||
279656
- provider === AllowedProviders.github) &&
279656
+ const loadGithub = (provider === config_AllowedProviders.all ||
279657
+ provider === config_AllowedProviders.catalog ||
279658
+ provider === config_AllowedProviders.github) &&
279657
279659
  'github' in claim.providers;
279658
- const loadCatalog = provider === AllowedProviders.all || provider === AllowedProviders.catalog;
279660
+ const loadCatalog = provider === config_AllowedProviders.all || provider === config_AllowedProviders.catalog;
279659
279661
  switch (claim.kind) {
279660
279662
  case 'DomainClaim':
279661
279663
  if (loadCatalog) {
@@ -279693,8 +279695,8 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
279693
279695
  break;
279694
279696
  case 'TFWorkspaceClaim':
279695
279697
  if (claim.providers.terraform &&
279696
- (provider === AllowedProviders.terraform ||
279697
- provider === AllowedProviders.all)) {
279698
+ (provider === config_AllowedProviders.terraform ||
279699
+ provider === config_AllowedProviders.all)) {
279698
279700
  firestartrEntity = new charts.TFWorkspaceChart(firestartrScope, `terraform-${chartId}`, firestartrId, claim, renderPatches);
279699
279701
  }
279700
279702
  if (loadCatalog) {
@@ -279703,9 +279705,9 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
279703
279705
  break;
279704
279706
  case 'SecretsClaim':
279705
279707
  if (claim.providers.external_secrets &&
279706
- (provider === AllowedProviders.externalSecrets ||
279707
- provider === AllowedProviders.terraform ||
279708
- provider === AllowedProviders.all)) {
279708
+ (provider === config_AllowedProviders.externalSecrets ||
279709
+ provider === config_AllowedProviders.terraform ||
279710
+ provider === config_AllowedProviders.all)) {
279709
279711
  firestartrEntity = new charts.SecretsChart(firestartrScope, chartId, firestartrId, claim, []);
279710
279712
  }
279711
279713
  if (loadCatalog) {
@@ -279714,8 +279716,8 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
279714
279716
  break;
279715
279717
  case 'ArgoDeployClaim':
279716
279718
  if (claim.providers.argocd &&
279717
- (provider === AllowedProviders.argocd ||
279718
- provider === AllowedProviders.all)) {
279719
+ (provider === config_AllowedProviders.argocd ||
279720
+ provider === config_AllowedProviders.all)) {
279719
279721
  firestartrEntity = new charts.ArgoDeployChart(firestartrScope, `argocd-${chartId}`, firestartrId, claim, renderPatches);
279720
279722
  }
279721
279723
  if (loadCatalog) {
@@ -279783,9 +279785,9 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
279783
279785
  async function renderer_render(catalogScope, firestartrScope, activateReferentialIntegrityValidation = true, claimList) {
279784
279786
  const data = await loadClaimsList(claimList);
279785
279787
  const result = await renderClaims(catalogScope, firestartrScope, data);
279786
- if (activateReferentialIntegrityValidation) {
279787
- validateReferentialIntegrity(result);
279788
- }
279788
+ //if (activateReferentialIntegrityValidation) {
279789
+ // validateReferentialIntegrity(result);
279790
+ //}
279789
279791
  validateTfStateKeyUniqueness(result);
279790
279792
  return result;
279791
279793
  }
@@ -280071,7 +280073,7 @@ async function addLastStateAndLastClaimAnnotations(filePath, lastStatePRLink, la
280071
280073
  INITIALIZERS: INITIALIZERS,
280072
280074
  INITIALIZERS_BY_FILE_NAME: INITIALIZERS_BY_FILE_NAME,
280073
280075
  NORMALIZERS: NORMALIZERS,
280074
- AllowedProviders: AllowedProviders,
280076
+ AllowedProviders: config_AllowedProviders,
280075
280077
  runComparer: runComparer,
280076
280078
  isCatalogEntity: isCatalogEntity,
280077
280079
  loadCRs: loadCRs,
@@ -281152,7 +281154,7 @@ function compileReg(value) {
281152
281154
  // gh-group: 'FirestartrGithubGroup',
281153
281155
  // gh-repo: 'FirestartrGithubRepository',
281154
281156
  // }
281155
- async function runImporter(force, generateDefaults, skipPlan, claimsPath, crsPath, configPath, claimsDefaultsPath, org, filters, provider = AllowedProviders.all) {
281157
+ async function runImporter(force, generateDefaults, skipPlan, claimsPath, crsPath, configPath, claimsDefaultsPath, org, filters, provider = config_AllowedProviders.all) {
281156
281158
  configureProvider(provider);
281157
281159
  let generatedFilters = [];
281158
281160
  //gh-repo,REGEXP=.*vite.*
@@ -2,4 +2,4 @@ export declare function resolveStringReference(reference: string): any;
2
2
  export declare function claimsRefListAsGenerator(refs: string[]): AsyncGenerator<string, void, unknown>;
3
3
  export declare function resolveClaimFilesList(claimRefsList: string): string[];
4
4
  export declare function resolveClaimEntries(claimRefsList: string[]): AsyncGenerator<string, void, unknown>;
5
- export declare function resolveClaimFileRef(claimFile: string): string;
5
+ export declare function resolveClaimFileRef(claimFile: string): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.46.0-snapshot-0",
3
+ "version": "1.46.0-snapshot-1",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",