@firestartr/cli 2.8.0-snapshot-1 → 2.8.0-snapshot-3

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
@@ -320683,6 +320683,13 @@ const GithubSchemas = [
320683
320683
  module: {
320684
320684
  type: 'string',
320685
320685
  },
320686
+ variants: {
320687
+ type: 'array',
320688
+ items: {
320689
+ $ref: 'firestartr.dev://terraform/TerraformProviderVariant',
320690
+ },
320691
+ description: 'variant clones of this workspace — stripped before parent claim validation',
320692
+ },
320686
320693
  context: {
320687
320694
  type: 'object',
320688
320695
  properties: {
@@ -320717,6 +320724,90 @@ const GithubSchemas = [
320717
320724
  },
320718
320725
  ],
320719
320726
  },
320727
+ TerraformProviderVariantOverride: {
320728
+ $id: 'firestartr.dev://terraform/TerraformProviderVariantOverride',
320729
+ description: 'Override fields for a variant of a TFWorkspaceClaim',
320730
+ type: 'object',
320731
+ properties: {
320732
+ name: {
320733
+ type: 'string',
320734
+ description: 'override the terraform provider name',
320735
+ },
320736
+ values: {
320737
+ type: 'object',
320738
+ additionalProperties: true,
320739
+ description: 'override values',
320740
+ },
320741
+ context: {
320742
+ type: 'object',
320743
+ properties: {
320744
+ providers: {
320745
+ type: 'array',
320746
+ items: {
320747
+ type: 'object',
320748
+ properties: { name: { type: 'string' } },
320749
+ additionalProperties: false,
320750
+ },
320751
+ },
320752
+ backend: {
320753
+ type: 'object',
320754
+ properties: { name: { type: 'string' } },
320755
+ additionalProperties: false,
320756
+ },
320757
+ },
320758
+ additionalProperties: false,
320759
+ description: 'override context',
320760
+ },
320761
+ files: {
320762
+ $ref: 'firestartr.dev://terraform/TerraformProviderFiles',
320763
+ },
320764
+ policy: {
320765
+ type: 'string',
320766
+ enum: [
320767
+ 'apply',
320768
+ 'create-only',
320769
+ 'create-update-only',
320770
+ 'full-control',
320771
+ 'observe',
320772
+ 'observe-only',
320773
+ ],
320774
+ },
320775
+ tfStateKey: {
320776
+ $ref: 'firestartr.dev://common/TerraformStateKey',
320777
+ },
320778
+ sync: {
320779
+ type: 'object',
320780
+ properties: {
320781
+ enabled: { type: 'boolean' },
320782
+ period: { type: 'string', pattern: '^[0-9]+[smhd]$' },
320783
+ schedule: { type: 'string' },
320784
+ schedule_timezone: { type: 'string' },
320785
+ policy: { type: 'string' },
320786
+ },
320787
+ additionalProperties: false,
320788
+ },
320789
+ valuesSchema: {
320790
+ type: 'string',
320791
+ },
320792
+ },
320793
+ additionalProperties: false,
320794
+ },
320795
+ TerraformProviderVariant: {
320796
+ $id: 'firestartr.dev://terraform/TerraformProviderVariant',
320797
+ description: 'A single variant of a TFWorkspace',
320798
+ type: 'object',
320799
+ properties: {
320800
+ name: {
320801
+ type: 'string',
320802
+ description: 'name of the variant — used as claim name and CR name base',
320803
+ },
320804
+ overrides: {
320805
+ $ref: 'firestartr.dev://terraform/TerraformProviderVariantOverride',
320806
+ },
320807
+ },
320808
+ additionalProperties: false,
320809
+ required: ['name', 'overrides'],
320810
+ },
320720
320811
  },
320721
320812
  });
320722
320813
 
@@ -321187,6 +321278,12 @@ async function loadClaim(claimRef, org, defaults = loadClaimDefaults(), patchCla
321187
321278
  try {
321188
321279
  const claimData = await lazyGetClaim(claimRef.split(/-/)[0], claimRef.replace(/^[^-]+-/, ''), org, cwd);
321189
321280
  const claim = patchClaim(catalog_common/* default.io.fromYaml */.Z.io.fromYaml(claimData), defaults);
321281
+ let variants = [];
321282
+ if (claim.kind === 'TFWorkspaceClaim' &&
321283
+ claim.providers?.terraform?.variants) {
321284
+ variants = claim.providers.terraform.variants;
321285
+ delete claim.providers.terraform.variants;
321286
+ }
321190
321287
  logger.silly(`Patched claim is:
321191
321288
  ---
321192
321289
  ${catalog_common/* default.io.toYaml */.Z.io.toYaml(claim)}`);
@@ -321224,6 +321321,47 @@ async function loadClaim(claimRef, org, defaults = loadClaimDefaults(), patchCla
321224
321321
  result = lodash_default().merge(result, resolvedReferences);
321225
321322
  }
321226
321323
  }
321324
+ if (variants.length > 0) {
321325
+ const parentClaimPath = VisitedClaims[claimRef];
321326
+ for (const variant of variants) {
321327
+ if (!variant.name || !variant.overrides) {
321328
+ throw new Error(`Variant in claim ${claimRef} is missing required field 'name' or 'overrides'`);
321329
+ }
321330
+ const prohibitedOverrideFields = ['source', 'module'];
321331
+ for (const field of prohibitedOverrideFields) {
321332
+ if (field in variant.overrides) {
321333
+ throw new Error(`Variant '${variant.name}' in claim ${claimRef} cannot override '${field}'`);
321334
+ }
321335
+ }
321336
+ const variantClaim = lodash_default().cloneDeep(claim);
321337
+ variantClaim.name = variant.name;
321338
+ variantClaim.providers.terraform = lodash_default().merge({}, claim.providers.terraform, variant.overrides);
321339
+ if (!variant.overrides.name) {
321340
+ variantClaim.providers.terraform.name = variant.name;
321341
+ }
321342
+ if (!variantClaim.annotations) {
321343
+ variantClaim.annotations = {};
321344
+ }
321345
+ variantClaim.annotations['firestartr.dev/variant-of'] =
321346
+ claim.providers.terraform.name;
321347
+ const variantRef = `TFWorkspaceClaim-${variant.name}`;
321348
+ if (result[variantRef]) {
321349
+ throw new Error(`Variant name '${variant.name}' from claim '${claimRef}' conflicts with existing claim '${variantRef}'`);
321350
+ }
321351
+ logger.info(`Creating synthetic variant claim ${variantRef}`);
321352
+ result[variantRef] = {};
321353
+ result[variantRef]['claim'] = variantClaim;
321354
+ result[variantRef]['claimPath'] = parentClaimPath;
321355
+ result = await setNonVirtualClaimAdditionalData(result, variantClaim, variantRef, loadInitializers, loadGlobals, loadOverrides, loadNormalizers);
321356
+ const variantReferences = extractAllRefs(catalog_common/* default.io.toYaml */.Z.io.toYaml(variantClaim));
321357
+ for (const ref of variantReferences) {
321358
+ if (!result[ref]) {
321359
+ const [resolvedReferences] = await loadClaim(ref, org, defaults, patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, cwd, result, postValidations);
321360
+ result = lodash_default().merge(result, resolvedReferences);
321361
+ }
321362
+ }
321363
+ }
321364
+ }
321227
321365
  }
321228
321366
  catch (err) {
321229
321367
  throw `Lazy Loading: ${err}`;
@@ -323668,47 +323806,6 @@ function sanitizeApiEntityName(name) {
323668
323806
  .replace(/[^a-z0-9-]/g, '-')
323669
323807
  .replace(/^-+|-+$/g, '');
323670
323808
  }
323671
- async function generateClaimsMap(claimsPath, outputPath, sha) {
323672
- const map = {
323673
- headers: {
323674
- sha: sha ?? '',
323675
- },
323676
- claims: {},
323677
- };
323678
- await crawlClaimsDir(claimsPath, claimsPath, map.claims);
323679
- await external_fs_default().promises.writeFile(outputPath, JSON.stringify(map, null, 2), 'utf-8');
323680
- }
323681
- async function crawlClaimsDir(dir, basePath, claims) {
323682
- let entries;
323683
- try {
323684
- entries = await (0,promises_.readdir)(dir, { withFileTypes: true });
323685
- }
323686
- catch (err) {
323687
- throw new Error(`Reading directory ${dir}: ${err}`);
323688
- }
323689
- for (const entry of entries) {
323690
- const fullPath = external_path_default().join(dir, entry.name);
323691
- if (entry.isDirectory()) {
323692
- await crawlClaimsDir(fullPath, basePath, claims);
323693
- }
323694
- else if (entry.isFile() && entry.name.match(/\.yaml$|\.yml$/)) {
323695
- try {
323696
- const data = await external_fs_default().promises.readFile(fullPath, 'utf-8');
323697
- const claim = catalog_common/* default.io.fromYaml */.Z.io.fromYaml(data);
323698
- if (!('kind' in claim && 'name' in claim)) {
323699
- logger.warn(`Skipping file ${fullPath}: missing kind or name`);
323700
- continue;
323701
- }
323702
- const ref = `${claim.kind}-${claim.name}`;
323703
- const relativePath = external_path_default().relative(basePath, fullPath);
323704
- claims[ref] = { filePath: relativePath };
323705
- }
323706
- catch (err) {
323707
- throw new Error(`Error processing claim file ${fullPath}: ${err}`);
323708
- }
323709
- }
323710
- }
323711
- }
323712
323809
 
323713
323810
  ;// CONCATENATED MODULE: ../cdk8s_renderer/imports/firestartr.dev.ts
323714
323811
  // generated by cdk8s
@@ -327713,6 +327810,9 @@ class TFWorkspaceChart extends BaseWorkspaceChart {
327713
327810
  return {
327714
327811
  metadata: {
327715
327812
  name: claim.providers.terraform.name,
327813
+ ...(claim.annotations && Object.keys(claim.annotations).length > 0
327814
+ ? { annotations: claim.annotations }
327815
+ : {}),
327716
327816
  },
327717
327817
  spec: {
327718
327818
  firestartr: {
@@ -328066,6 +328166,7 @@ class SecretsChart extends BaseSecretsChart {
328066
328166
 
328067
328167
 
328068
328168
 
328169
+
328069
328170
  function normalizeProvidesApis(providesApis) {
328070
328171
  if (!providesApis)
328071
328172
  return [];
@@ -328136,7 +328237,10 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
328136
328237
  let catalogEntity = undefined;
328137
328238
  let firestartrEntity = undefined;
328138
328239
  const extraCharts = [];
328139
- const chartId = `${claim.kind}-${claim.name}`.toLowerCase();
328240
+ const isVariant = claim.annotations?.['firestartr.dev/variant-of'] !== undefined;
328241
+ const chartId = isVariant
328242
+ ? `${claim.kind}-${claim.name}.variant`.toLowerCase()
328243
+ : `${claim.kind}-${claim.name}`.toLowerCase();
328140
328244
  let firestartrId = null;
328141
328245
  if (previousCR) {
328142
328246
  firestartrId = previousCR?.spec?.firestartr?.tfStateKey || null;
@@ -328316,6 +328420,21 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
328316
328420
  ],
328317
328421
  };
328318
328422
  }
328423
+ function renameVariantCrFiles(outputDir, renderedMap) {
328424
+ for (const cr of Object.values(renderedMap)) {
328425
+ const crJson = cr.toJson ? cr.toJson() : cr;
328426
+ if (crJson.metadata?.annotations?.['firestartr.dev/variant-of'] &&
328427
+ crJson.kind &&
328428
+ crJson.metadata?.name) {
328429
+ const oldPath = external_path_.join(outputDir, `${crJson.kind}.${crJson.metadata.name}.yaml`);
328430
+ const newPath = external_path_.join(outputDir, `${crJson.kind}.${crJson.metadata.name}.variant.yaml`);
328431
+ if (external_fs_.existsSync(oldPath)) {
328432
+ external_fs_.renameSync(oldPath, newPath);
328433
+ logger.info(`Renamed variant CR file: ${oldPath} -> ${newPath}`);
328434
+ }
328435
+ }
328436
+ }
328437
+ }
328319
328438
 
328320
328439
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/crossReferences.ts
328321
328440
 
@@ -328820,6 +328939,9 @@ async function renderFromImports(rClaims, crs = {}, catalogOutputDir = '/tmp/.ca
328820
328939
  });
328821
328940
  const result = await renderClaims(catalogScope, firestartrScope, { renderClaims: rClaims, crs, renames: [] });
328822
328941
  firestartrScope.synth();
328942
+ if (crOutputDir) {
328943
+ renameVariantCrFiles(crOutputDir, result);
328944
+ }
328823
328945
  return result;
328824
328946
  }
328825
328947
  async function solver(type, value, rClaims) {
@@ -328957,8 +329079,9 @@ async function runRenderer(globalsPath, initializersPath, claimsPath, crsPath, c
328957
329079
  // the system takes everything defined in the claims path
328958
329080
  claimRefsList = await resolveClaimEntries([claimsPath]);
328959
329081
  }
329082
+ let renderedMap;
328960
329083
  try {
328961
- await renderer_render(catalogApp, firestartrApp, claimRefsList);
329084
+ renderedMap = await renderer_render(catalogApp, firestartrApp, claimRefsList);
328962
329085
  }
328963
329086
  catch (error) {
328964
329087
  console.log(`Rendering the system: \n ${error}`);
@@ -328966,6 +329089,7 @@ async function runRenderer(globalsPath, initializersPath, claimsPath, crsPath, c
328966
329089
  }
328967
329090
  catalogApp.synth();
328968
329091
  firestartrApp.synth();
329092
+ renameVariantCrFiles(outputCrDir, renderedMap);
328969
329093
  }
328970
329094
 
328971
329095
  ;// CONCATENATED MODULE: ../importer/src/decanter/config.ts
@@ -341918,6 +342042,7 @@ function gh_checkrun_helperCreateCheckRunName(cmd, item) {
341918
342042
 
341919
342043
 
341920
342044
 
342045
+
341921
342046
  const process_operation_TF_CACHES_PATH = '/tmp/tfcaches';
341922
342047
  function process_operation_processOperation(item, op, handler) {
341923
342048
  operator_src_logger.info(`Processing operation ${op} on ${item.kind}/${item.metadata?.name}`);
@@ -342081,19 +342206,13 @@ async function* gh_process_operation_markedToDeletion(item, op, handler) {
342081
342206
  }
342082
342207
  catch (e) {
342083
342208
  error = true;
342084
- let errorMsg;
342085
- if (typeof e === 'object' && 'output' in e) {
342086
- errorMsg = e.output;
342087
- }
342088
- else {
342089
- errorMsg = e;
342090
- }
342209
+ const { output: errorMsg, exitCode: errCode } = extractErrorDetails(e);
342091
342210
  // if there is a current checkRun working
342092
342211
  // we close it with an error
342093
342212
  if (checkRunCtl)
342094
342213
  checkRunCtl.fnOnError(errorMsg);
342095
342214
  await tryPublishDestroy(item, errorMsg, false);
342096
- await handler.writeTerraformOutputInTfResult(item, errorMsg, 1);
342215
+ await handler.writeTerraformOutputInTfResult(item, errorMsg, errCode ?? 1);
342097
342216
  void handler.error();
342098
342217
  }
342099
342218
  finally {
@@ -342244,15 +342363,9 @@ async function* process_operation_doApply(item, op, handler) {
342244
342363
  }
342245
342364
  catch (e) {
342246
342365
  error = true;
342247
- let errorMsg;
342248
- if (typeof e === 'object' && 'output' in e) {
342249
- errorMsg = e.output;
342250
- }
342251
- else {
342252
- errorMsg = e;
342253
- }
342366
+ const { output: errorMsg, exitCode: errCode } = extractErrorDetails(e);
342254
342367
  // being one the exitCode
342255
- await tryPublishApply(item, errorMsg, false, 1);
342368
+ await tryPublishApply(item, errorMsg, false, errCode ?? 1);
342256
342369
  // if there is a current checkRun working
342257
342370
  // we close it with an error
342258
342371
  if (checkRunCtl)
@@ -342262,7 +342375,7 @@ async function* process_operation_doApply(item, op, handler) {
342262
342375
  operator_src_logger.error(`Error applying item ${item.metadata.name}: ${errorMsg}`);
342263
342376
  handler.error();
342264
342377
  if (errorMsg) {
342265
- await handler.writeTerraformOutputInTfResult(item, errorMsg, 1);
342378
+ await handler.writeTerraformOutputInTfResult(item, errorMsg, errCode ?? 1);
342266
342379
  }
342267
342380
  }
342268
342381
  finally {
@@ -342702,7 +342815,6 @@ const cdk8s_rendererSubcommands = {
342702
342815
  { name: 'render', alias: 'r', type: Boolean },
342703
342816
  { name: 'compare', type: Boolean },
342704
342817
  { name: 'render-plan', type: Boolean },
342705
- { name: 'generate-claims-map', type: Boolean },
342706
342818
  /**
342707
342819
  * Specific parameters for render functionality
342708
342820
  */
@@ -342759,10 +342871,6 @@ const cdk8s_rendererSubcommands = {
342759
342871
  { name: 'lastStatePrLink', type: String },
342760
342872
  { name: 'lastClaimPrLink', type: String },
342761
342873
  { name: 'crLocation', type: String },
342762
- /**
342763
- * Specific parameters for claims-map generation
342764
- */
342765
- { name: 'claims-map-output', alias: 'm', type: String },
342766
342874
  ],
342767
342875
  run: async (options) => {
342768
342876
  if (options['render']) {
@@ -342775,9 +342883,6 @@ const cdk8s_rendererSubcommands = {
342775
342883
  else if (options['lastStatePrLink'] && options['lastClaimPrLink']) {
342776
342884
  await cdk8s_renderer.addLastStateAndLastClaimAnnotations(options['crLocation'], options['lastStatePrLink'], options['lastClaimPrLink']);
342777
342885
  }
342778
- else if (options['generate-claims-map']) {
342779
- await generateClaimsMap(options['claims'], options['claims-map-output'], options['sha']);
342780
- }
342781
342886
  },
342782
342887
  };
342783
342888
 
@@ -521419,9 +521524,9 @@ const crsStatusSubcommand = {
521419
521524
  };
521420
521525
 
521421
521526
  ;// CONCATENATED MODULE: ./package.json
521422
- const package_namespaceObject = JSON.parse('{"i8":"2.8.0-snapshot-1"}');
521527
+ const package_namespaceObject = JSON.parse('{"i8":"2.8.0-snapshot-3"}');
521423
521528
  ;// CONCATENATED MODULE: ../../package.json
521424
- const package_namespaceObject_1 = {"i8":"2.6.4"};
521529
+ const package_namespaceObject_1 = {"i8":"2.7.0"};
521425
521530
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
521426
521531
 
521427
521532
 
@@ -13,7 +13,6 @@ import { runComparer } from './src/comparer';
13
13
  import { AllowedProviders, setDefaultBranch, setPath, setRepositoryUrl } from './src/config';
14
14
  import { render } from './src/renderer/renderer';
15
15
  export { AllowedProviders, configureProvider, setDefaultBranch, setRepositoryUrl, } from './src/config';
16
- export { generateClaimsMap } from './src/utils/claimUtils';
17
16
  import { isCatalogEntity } from './src/validations/references';
18
17
  import { normalizeModuleContent } from './src/normalizers';
19
18
  import { loadCRs } from './src/loader/loader';
@@ -1192,6 +1192,13 @@ declare const schemas: {
1192
1192
  module: {
1193
1193
  type: string;
1194
1194
  };
1195
+ variants: {
1196
+ type: string;
1197
+ items: {
1198
+ $ref: string;
1199
+ };
1200
+ description: string;
1201
+ };
1195
1202
  context: {
1196
1203
  type: string;
1197
1204
  properties: {
@@ -1226,6 +1233,102 @@ declare const schemas: {
1226
1233
  $ref?: undefined;
1227
1234
  })[];
1228
1235
  };
1236
+ TerraformProviderVariantOverride: {
1237
+ $id: string;
1238
+ description: string;
1239
+ type: string;
1240
+ properties: {
1241
+ name: {
1242
+ type: string;
1243
+ description: string;
1244
+ };
1245
+ values: {
1246
+ type: string;
1247
+ additionalProperties: boolean;
1248
+ description: string;
1249
+ };
1250
+ context: {
1251
+ type: string;
1252
+ properties: {
1253
+ providers: {
1254
+ type: string;
1255
+ items: {
1256
+ type: string;
1257
+ properties: {
1258
+ name: {
1259
+ type: string;
1260
+ };
1261
+ };
1262
+ additionalProperties: boolean;
1263
+ };
1264
+ };
1265
+ backend: {
1266
+ type: string;
1267
+ properties: {
1268
+ name: {
1269
+ type: string;
1270
+ };
1271
+ };
1272
+ additionalProperties: boolean;
1273
+ };
1274
+ };
1275
+ additionalProperties: boolean;
1276
+ description: string;
1277
+ };
1278
+ files: {
1279
+ $ref: string;
1280
+ };
1281
+ policy: {
1282
+ type: string;
1283
+ enum: string[];
1284
+ };
1285
+ tfStateKey: {
1286
+ $ref: string;
1287
+ };
1288
+ sync: {
1289
+ type: string;
1290
+ properties: {
1291
+ enabled: {
1292
+ type: string;
1293
+ };
1294
+ period: {
1295
+ type: string;
1296
+ pattern: string;
1297
+ };
1298
+ schedule: {
1299
+ type: string;
1300
+ };
1301
+ schedule_timezone: {
1302
+ type: string;
1303
+ };
1304
+ policy: {
1305
+ type: string;
1306
+ };
1307
+ };
1308
+ additionalProperties: boolean;
1309
+ };
1310
+ valuesSchema: {
1311
+ type: string;
1312
+ };
1313
+ };
1314
+ additionalProperties: boolean;
1315
+ };
1316
+ TerraformProviderVariant: {
1317
+ $id: string;
1318
+ description: string;
1319
+ type: string;
1320
+ properties: {
1321
+ name: {
1322
+ type: string;
1323
+ description: string;
1324
+ };
1325
+ overrides: {
1326
+ $ref: string;
1327
+ };
1328
+ };
1329
+ additionalProperties: boolean;
1330
+ required: string[];
1331
+ };
1229
1332
  };
1230
1333
  }[] | {
1231
1334
  $schema: string;
@@ -97,6 +97,13 @@ export declare const TerraformSchemas: {
97
97
  module: {
98
98
  type: string;
99
99
  };
100
+ variants: {
101
+ type: string;
102
+ items: {
103
+ $ref: string;
104
+ };
105
+ description: string;
106
+ };
100
107
  context: {
101
108
  type: string;
102
109
  properties: {
@@ -131,5 +138,101 @@ export declare const TerraformSchemas: {
131
138
  $ref?: undefined;
132
139
  })[];
133
140
  };
141
+ TerraformProviderVariantOverride: {
142
+ $id: string;
143
+ description: string;
144
+ type: string;
145
+ properties: {
146
+ name: {
147
+ type: string;
148
+ description: string;
149
+ };
150
+ values: {
151
+ type: string;
152
+ additionalProperties: boolean;
153
+ description: string;
154
+ };
155
+ context: {
156
+ type: string;
157
+ properties: {
158
+ providers: {
159
+ type: string;
160
+ items: {
161
+ type: string;
162
+ properties: {
163
+ name: {
164
+ type: string;
165
+ };
166
+ };
167
+ additionalProperties: boolean;
168
+ };
169
+ };
170
+ backend: {
171
+ type: string;
172
+ properties: {
173
+ name: {
174
+ type: string;
175
+ };
176
+ };
177
+ additionalProperties: boolean;
178
+ };
179
+ };
180
+ additionalProperties: boolean;
181
+ description: string;
182
+ };
183
+ files: {
184
+ $ref: string;
185
+ };
186
+ policy: {
187
+ type: string;
188
+ enum: string[];
189
+ };
190
+ tfStateKey: {
191
+ $ref: string;
192
+ };
193
+ sync: {
194
+ type: string;
195
+ properties: {
196
+ enabled: {
197
+ type: string;
198
+ };
199
+ period: {
200
+ type: string;
201
+ pattern: string;
202
+ };
203
+ schedule: {
204
+ type: string;
205
+ };
206
+ schedule_timezone: {
207
+ type: string;
208
+ };
209
+ policy: {
210
+ type: string;
211
+ };
212
+ };
213
+ additionalProperties: boolean;
214
+ };
215
+ valuesSchema: {
216
+ type: string;
217
+ };
218
+ };
219
+ additionalProperties: boolean;
220
+ };
221
+ TerraformProviderVariant: {
222
+ $id: string;
223
+ description: string;
224
+ type: string;
225
+ properties: {
226
+ name: {
227
+ type: string;
228
+ description: string;
229
+ };
230
+ overrides: {
231
+ $ref: string;
232
+ };
233
+ };
234
+ additionalProperties: boolean;
235
+ required: string[];
236
+ };
134
237
  };
135
238
  }[];
@@ -97,6 +97,13 @@ declare const _default: {
97
97
  module: {
98
98
  type: string;
99
99
  };
100
+ variants: {
101
+ type: string;
102
+ items: {
103
+ $ref: string;
104
+ };
105
+ description: string;
106
+ };
100
107
  context: {
101
108
  type: string;
102
109
  properties: {
@@ -131,6 +138,102 @@ declare const _default: {
131
138
  $ref?: undefined;
132
139
  })[];
133
140
  };
141
+ TerraformProviderVariantOverride: {
142
+ $id: string;
143
+ description: string;
144
+ type: string;
145
+ properties: {
146
+ name: {
147
+ type: string;
148
+ description: string;
149
+ };
150
+ values: {
151
+ type: string;
152
+ additionalProperties: boolean;
153
+ description: string;
154
+ };
155
+ context: {
156
+ type: string;
157
+ properties: {
158
+ providers: {
159
+ type: string;
160
+ items: {
161
+ type: string;
162
+ properties: {
163
+ name: {
164
+ type: string;
165
+ };
166
+ };
167
+ additionalProperties: boolean;
168
+ };
169
+ };
170
+ backend: {
171
+ type: string;
172
+ properties: {
173
+ name: {
174
+ type: string;
175
+ };
176
+ };
177
+ additionalProperties: boolean;
178
+ };
179
+ };
180
+ additionalProperties: boolean;
181
+ description: string;
182
+ };
183
+ files: {
184
+ $ref: string;
185
+ };
186
+ policy: {
187
+ type: string;
188
+ enum: string[];
189
+ };
190
+ tfStateKey: {
191
+ $ref: string;
192
+ };
193
+ sync: {
194
+ type: string;
195
+ properties: {
196
+ enabled: {
197
+ type: string;
198
+ };
199
+ period: {
200
+ type: string;
201
+ pattern: string;
202
+ };
203
+ schedule: {
204
+ type: string;
205
+ };
206
+ schedule_timezone: {
207
+ type: string;
208
+ };
209
+ policy: {
210
+ type: string;
211
+ };
212
+ };
213
+ additionalProperties: boolean;
214
+ };
215
+ valuesSchema: {
216
+ type: string;
217
+ };
218
+ };
219
+ additionalProperties: boolean;
220
+ };
221
+ TerraformProviderVariant: {
222
+ $id: string;
223
+ description: string;
224
+ type: string;
225
+ properties: {
226
+ name: {
227
+ type: string;
228
+ description: string;
229
+ };
230
+ overrides: {
231
+ $ref: string;
232
+ };
233
+ };
234
+ additionalProperties: boolean;
235
+ required: string[];
236
+ };
134
237
  };
135
238
  };
136
239
  export default _default;
@@ -9,3 +9,4 @@ export declare function renderClaims(catalogScope: Construct, firestartrScope: C
9
9
  renames?: IRenameResult[];
10
10
  }): Promise<RenderedCrMap>;
11
11
  export declare function renderClaim(catalogScope: Construct, firestartrScope: Construct, claim: any, patches: ICustomResourcePatch[], previousCR?: any | null, claimPath?: string): Promise<IRenderClaimResult>;
12
+ export declare function renameVariantCrFiles(outputDir: string, renderedMap: RenderedCrMap): void;
@@ -5,13 +5,3 @@ export declare function resolveClaimEntries(claimRefsList: string[]): AsyncGener
5
5
  export declare function resolveClaimFileRef(claimFile: string): Promise<string>;
6
6
  export declare function getClaimsEntryAbsolutePath(claimsDir: string, entryPath: string): string;
7
7
  export declare function sanitizeApiEntityName(name: string): string;
8
- export interface ClaimsMapEntry {
9
- filePath: string;
10
- }
11
- export interface ClaimsMap {
12
- headers: {
13
- sha: string;
14
- };
15
- claims: Record<string, ClaimsMapEntry>;
16
- }
17
- export declare function generateClaimsMap(claimsPath: string, outputPath: string, sha?: string): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "2.8.0-snapshot-1",
3
+ "version": "2.8.0-snapshot-3",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",