@firestartr/cli 1.43.1 → 1.43.2-snapshot-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 CHANGED
@@ -271394,7 +271394,7 @@ function fromYaml(data) {
271394
271394
  return result;
271395
271395
  }
271396
271396
  function toYaml(data, opts = {}) {
271397
- messageLog('opts', opts);
271397
+ console.log('opts', opts);
271398
271398
  const result = yaml_dist.stringify(data);
271399
271399
  return result;
271400
271400
  }
@@ -273032,20 +273032,20 @@ const fullMembersTeam = getFromEnvironmentWithDefault(envVars.fullOrgGroup, `${o
273032
273032
 
273033
273033
  const tarballs_messageLog = src_default()('firestartr:catalog_common:features:tarballs');
273034
273034
  function getFeatureZipDownloadPath(featureName, version) {
273035
- const featureDownloadPath = `/tmp/${featureName}-${version}-zipball.zip`;
273036
- tarballs_messageLog('Feature tarball download path %s', featureDownloadPath);
273037
- return featureDownloadPath;
273035
+ const featureTarballDownloadPath = `/tmp/${featureName}-${version}-zipball.zip`;
273036
+ tarballs_messageLog('Feature tarball download path %s', featureTarballDownloadPath);
273037
+ return featureTarballDownloadPath;
273038
273038
  }
273039
273039
  function removeFeatureTarball(featureName, version) {
273040
- const featurePath = getFeatureZipDownloadPath(featureName, version);
273041
- tarballs_messageLog('Removing feature tarball %s', featurePath);
273042
- external_fs_.unlinkSync(featurePath);
273043
- tarballs_messageLog(`Removed tarball for feature ${featureName} and version ${version}: ${featurePath}`);
273040
+ const tarballPath = getFeatureZipDownloadPath(featureName, version);
273041
+ tarballs_messageLog('Removing feature tarball %s', tarballPath);
273042
+ external_fs_.unlinkSync(tarballPath);
273043
+ tarballs_messageLog(`Removed tarball for feature ${featureName} and version ${version}: ${tarballPath}`);
273044
273044
  }
273045
273045
  function featureTarballExists(featureName, version) {
273046
- const featurePath = getFeatureZipDownloadPath(featureName, version);
273047
- const exists = external_fs_.existsSync(featurePath);
273048
- tarballs_messageLog(`Tarball ${featurePath} exists? ${exists}`);
273046
+ const tarballPath = getFeatureZipDownloadPath(featureName, version);
273047
+ const exists = external_fs_.existsSync(tarballPath);
273048
+ tarballs_messageLog(`Tarball ${tarballPath} exists? ${exists}`);
273049
273049
  return exists;
273050
273050
  }
273051
273051
  function getFeaturesExtractPath(featureName, version, options = {}) {
@@ -281289,12 +281289,6 @@ class FirestartrAllClaim {
281289
281289
  type: 'string',
281290
281290
  enum: ['private', 'public', 'internal'],
281291
281291
  },
281292
- features: {
281293
- type: 'array',
281294
- items: {
281295
- $ref: 'firestartr.dev://github/GithubComponentFeatureClaim',
281296
- },
281297
- },
281298
281292
  },
281299
281293
  required: ['visibility', 'org'],
281300
281294
  },
@@ -281355,58 +281349,14 @@ class FirestartrAllClaim {
281355
281349
  },
281356
281350
  });
281357
281351
 
281358
- ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/feature.schema.ts
281359
- /* harmony default export */ const feature_schema = ({
281360
- $schema: 'http://json-schema.org/draft-07/schema#',
281361
- $id: 'GithubComponentFeatureClaim',
281362
- definitions: {
281363
- GithubComponentFeatureClaim: {
281364
- $id: 'firestartr.dev://github/GithubComponentFeatureClaim',
281365
- description: 'A feature for a GithubComponentClaim',
281366
- properties: {
281367
- name: {
281368
- type: 'string',
281369
- description: 'The name of the feature',
281370
- },
281371
- version: {
281372
- type: 'string',
281373
- description: 'The semver of the feature',
281374
- },
281375
- ref: {
281376
- type: 'string',
281377
- description: 'A github reference (commit, tag, branch)',
281378
- },
281379
- args: {
281380
- type: 'object',
281381
- properties: {},
281382
- additionalProperties: true,
281383
- },
281384
- repo: {
281385
- type: 'string',
281386
- description: 'A repo where the feature exists, format: owner/repository',
281387
- pattern: '^[a-zA-Z0-9-._]+/[a-zA-Z0-9-._]+$',
281388
- },
281389
- },
281390
- required: ['name'],
281391
- oneOf: [
281392
- { required: ['ref'], not: { required: ['version'] } },
281393
- { required: ['version'], not: { required: ['ref'] } },
281394
- ],
281395
- additionalProperties: false,
281396
- },
281397
- },
281398
- });
281399
-
281400
281352
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/index.ts
281401
281353
 
281402
281354
 
281403
281355
 
281404
281356
 
281405
-
281406
281357
  const GithubSchemas = [
281407
281358
  github_group_schema,
281408
281359
  github_user_schema,
281409
- feature_schema,
281410
281360
  github_component_schema,
281411
281361
  github_orgwebhook_schema,
281412
281362
  ];
@@ -281858,9 +281808,6 @@ const deploy_schema = 'firestartr.dev://common/ArgoDeployClaim';
281858
281808
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/base/orgWebhook.ts
281859
281809
  const orgWebhook_schema = 'firestartr.dev://common/OrgWebhookClaim';
281860
281810
 
281861
- ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/base/secrets.ts
281862
- const base_secrets_schema = 'firestartr.dev://common/SecretsClaim';
281863
-
281864
281811
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/base/index.ts
281865
281812
 
281866
281813
 
@@ -281870,7 +281817,6 @@ const base_secrets_schema = 'firestartr.dev://common/SecretsClaim';
281870
281817
 
281871
281818
 
281872
281819
 
281873
-
281874
281820
  /* harmony default export */ const base = ({
281875
281821
  UserClaimSchema: schema,
281876
281822
  GroupClaimSchema: base_group_schema,
@@ -281880,7 +281826,6 @@ const base_secrets_schema = 'firestartr.dev://common/SecretsClaim';
281880
281826
  TFWorkspaceClaimSchema: workspace_schema,
281881
281827
  ArgoDeployClaimSchema: deploy_schema,
281882
281828
  OrgWebhookClaimSchema: orgWebhook_schema,
281883
- SecretsClaimSchema: base_secrets_schema,
281884
281829
  });
281885
281830
 
281886
281831
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/normalizers/refValues.ts
@@ -282290,58 +282235,36 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
282290
282235
 
282291
282236
 
282292
282237
 
282293
-
282294
-
282295
-
282296
-
282297
282238
  const lazy_loader_log = src_default()('firestartr:renderer:lazy_loader');
282298
- async function loadClaim(claimRef, org, defaults = loadClaimDefaults(), patchClaim = loader_patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, cwd, existingRefs = {}) {
282239
+ async function loadClaim(claimRef, org, defaults, patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, cwd, existingRefs = {}) {
282299
282240
  let result = existingRefs;
282300
282241
  lazy_loader_log(`Load reference ${claimRef}`);
282301
282242
  initVirtualClaims(org);
282302
282243
  lazy_loader_log(`Load reference (parts) ${claimRef.split(/-/)[0]} ${claimRef.replace(/^[^-]+-/, '')}`);
282303
282244
  // cargas datos con grep
282304
- try {
282305
- const claimData = await lazyGetClaim(claimRef.split(/-/)[0], claimRef.replace(/^[^-]+-/, ''), org, cwd);
282306
- const claim = patchClaim(catalog_common.io.fromYaml(claimData), defaults);
282307
- try {
282308
- validateClaim(claim, base[`${claim.kind}Schema`]);
282309
- await optionalValidation(claim);
282310
- }
282311
- catch (error) {
282312
- let errorMsg = '';
282313
- for (const data of error) {
282314
- errorMsg = `${errorMsg}
282315
- - ${data.dataPath}: ${data.message}`;
282316
- }
282317
- throw new Error(`Error when validating claim ${claimRef}: ${errorMsg}`);
282318
- }
282319
- result[claimRef] = {};
282320
- result[claimRef]['claim'] = claim;
282321
- result[claimRef]['claimPath'] = VisitedClaims[claimRef];
282322
- if (VisitedClaims[claimRef] === 'virtual') {
282323
- result = await setVirtualClaimAdditionalData(result, claim, claimRef);
282324
- }
282325
- else {
282326
- result = await setNonVirtualClaimAdditionalData(result, claim, claimRef, loadInitializers, loadGlobals, loadOverrides, loadNormalizers);
282327
- }
282328
- const claimKind = claim.kind;
282329
- const references = extractAllRefs(catalog_common.io.toYaml(claim));
282330
- for (const ref of references) {
282331
- if (!result[ref]) {
282332
- const resolvedReferences = await loadClaim(ref, org, defaults, patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, cwd, result);
282333
- result = lodash_default().merge(result, resolvedReferences);
282334
- }
282335
- }
282245
+ const claimData = await lazyGetClaim(claimRef.split(/-/)[0], claimRef.replace(/^[^-]+-/, ''), org, cwd);
282246
+ const claim = patchClaim(catalog_common.io.fromYaml(claimData), defaults);
282247
+ result[claimRef] = {};
282248
+ result[claimRef]['claim'] = claim;
282249
+ result[claimRef]['claimPath'] = VisitedClaims[claimRef];
282250
+ if (VisitedClaims[claimRef] === 'virtual') {
282251
+ result = await setVirtualClaimAdditionalData(result, claim, claimRef);
282336
282252
  }
282337
- catch (err) {
282338
- throw `Lazy Loading: ${err}`;
282253
+ else {
282254
+ result = await setNonVirtualClaimAdditionalData(result, claim, claimRef, loadInitializers, loadGlobals, loadOverrides, loadNormalizers);
282255
+ }
282256
+ const claimKind = claim.kind;
282257
+ const references = extractAllRefs(catalog_common.io.toYaml(claim));
282258
+ for (const ref of references) {
282259
+ if (!result[ref]) {
282260
+ const resolvedReferences = await loadClaim(ref, org, defaults, patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, cwd, result);
282261
+ result = lodash_default().merge(result, resolvedReferences);
282262
+ }
282339
282263
  }
282340
282264
  return result;
282341
282265
  }
282342
282266
  const LoadedClaims = {};
282343
282267
  const VisitedClaims = {};
282344
- const DuplicatedClaims = {};
282345
282268
  async function lazyGetClaim(kind, name, org, cwd) {
282346
282269
  const indice = `${kind}-${name}`;
282347
282270
  lazy_loader_log(`Lazy loading ${kind}-${name} with index ${indice}`);
@@ -282384,14 +282307,14 @@ async function getClaimsByName(name, cwd = '.') {
282384
282307
  }
282385
282308
  });
282386
282309
  handler.on('close', () => {
282387
- return Promise.all(entradas.map((entrada) => {
282310
+ Promise.all(entradas.map((entrada) => {
282388
282311
  return loadRawClaim(entrada);
282389
282312
  }))
282390
282313
  .then(() => {
282391
282314
  ok();
282392
282315
  })
282393
- .catch((err) => {
282394
- ko(err);
282316
+ .catch(() => {
282317
+ ko();
282395
282318
  });
282396
282319
  });
282397
282320
  });
@@ -282405,17 +282328,9 @@ async function loadRawClaim(entry) {
282405
282328
  if (!('kind' in claim && 'name' in claim)) {
282406
282329
  lazy_loader_log(`Invalid claim file ${entry}`);
282407
282330
  }
282408
- else {
282409
- const claimKey = `${claim.kind}-${claim.name}`;
282410
- if (Object.keys(DuplicatedClaims).includes(claimKey) &&
282411
- DuplicatedClaims[claimKey] !== entry) {
282412
- return ko(`Duplicated claim ${claimKey} found files: ${DuplicatedClaims[claimKey]} and ${entry}`);
282413
- }
282414
- LoadedClaims[claimKey] = data;
282415
- VisitedClaims[claimKey] = entry;
282416
- DuplicatedClaims[claimKey] = entry;
282417
- ok();
282418
- }
282331
+ LoadedClaims[`${claim.kind}-${claim.name}`] = data;
282332
+ VisitedClaims[`${claim.kind}-${claim.name}`] = entry;
282333
+ ok();
282419
282334
  });
282420
282335
  });
282421
282336
  }
@@ -282637,7 +282552,7 @@ async function loadClaims(claimsPath = config_getPath('claims')) {
282637
282552
  await crawler_crawl(claimsPath, (entry) => {
282638
282553
  return isYamlFile.test(entry);
282639
282554
  }, async (entry, data) => {
282640
- const claim = loader_patchClaim(catalog_common.io.fromYaml(data), defaultsClaims);
282555
+ const claim = patchClaim(catalog_common.io.fromYaml(data), defaultsClaims);
282641
282556
  if (!('kind' in claim && 'name' in claim)) {
282642
282557
  throw new Error(`Invalid claim file ${entry}`);
282643
282558
  }
@@ -282674,7 +282589,7 @@ function loadClaimDefaults() {
282674
282589
  * - The patched claim
282675
282590
  *
282676
282591
  */
282677
- function loader_patchClaim(claim, defaultsClaims) {
282592
+ function patchClaim(claim, defaultsClaims) {
282678
282593
  if (defaultsClaims[claim.kind]) {
282679
282594
  const jsonPatchOps = fast_json_patch.compare(claim, defaultsClaims[claim.kind])
282680
282595
  .filter((jp) => {
@@ -282818,7 +282733,7 @@ async function loadClaimsList(claimRefList, claimsPath = config_getPath('claims'
282818
282733
  };
282819
282734
  const defaults = loadClaimDefaults();
282820
282735
  for (const claimRef of claimRefList) {
282821
- const renderedClaimData = await loadClaim(claimRef, getOrg(), defaults, loader_patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, claimsPath);
282736
+ const renderedClaimData = await loadClaim(claimRef, getOrg(), defaults, patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, claimsPath);
282822
282737
  data.renderClaims = lodash_default().merge(data.renderClaims, renderedClaimData);
282823
282738
  }
282824
282739
  const crClaimReferences = [];
@@ -284195,91 +284110,59 @@ function renderFeature(featureName, version, featureOwner, renderPath = '/tmp',
284195
284110
  // EXTERNAL MODULE: ../../node_modules/adm-zip/adm-zip.js
284196
284111
  var adm_zip = __nccwpck_require__(7993);
284197
284112
  var adm_zip_default = /*#__PURE__*/__nccwpck_require__.n(adm_zip);
284198
- // EXTERNAL MODULE: external "node:stream"
284199
- var external_node_stream_ = __nccwpck_require__(84492);
284200
- ;// CONCATENATED MODULE: external "node:stream/promises"
284201
- const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises");
284202
- ;// CONCATENATED MODULE: ../features_preparer/src/zip.ts
284203
-
284204
-
284205
-
284206
- async function downloadZipBall(url, filePath) {
284207
- try {
284208
- const zipResponse = await fetch(url);
284209
- if (!zipResponse.ok) {
284210
- throw new Error(`Failed to download ZIP: ${zipResponse.statusText}`);
284211
- }
284212
- const webStream = zipResponse.body;
284213
- const stream = external_node_stream_.Readable.fromWeb(webStream);
284214
- const writableStream = external_fs_.createWriteStream(filePath);
284215
- await (0,external_node_stream_promises_namespaceObject.pipeline)(stream, writableStream);
284216
- }
284217
- catch (err) {
284218
- throw new Error(`Downloading feature's zip: ${err.message}`);
284219
- }
284220
- }
284221
-
284222
284113
  ;// CONCATENATED MODULE: ../features_preparer/src/installer.ts
284223
284114
 
284224
284115
 
284225
284116
 
284226
284117
 
284227
284118
 
284228
-
284229
- async function getFeatureConfigFromRef(featureName, featureRef, featureOwner, // -> cr
284230
- featureArgs = {}, repo = 'features', owner = 'prefapp') {
284231
- // reference is the featureRef directly
284232
- const reference = `${featureRef}`;
284233
- return processFeature(featureName, reference, featureOwner, featureArgs, repo, owner);
284234
- }
284119
+ //const IS_COMMIT_REF = new RegExp(/\b[0-9a-f]{40}/g);
284120
+ const IS_SEMVER_REF = new RegExp(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([\da-zA-Z-]+(?:\.[\da-zA-Z-]+)*))?(?:\+([\da-zA-Z-]+(?:\.[\da-zA-Z-]+)*))?$/);
284235
284121
  async function getFeatureConfig(featureName, version, featureOwner, // -> cr
284236
284122
  featureArgs = {}, repo = 'features', owner = 'prefapp') {
284237
- const reference = `${featureName}-v${version}`;
284238
- return processFeature(featureName, reference, featureOwner, featureArgs, repo, owner);
284239
- }
284240
- async function processFeature(featureName, reference, featureOwner, // -> cr
284241
- featureArgs = {}, repo = 'features', owner = 'prefapp') {
284242
- await downloadFeatureZip(repo, featureName, reference, owner);
284123
+ await downloadFeatureZip(repo, featureName, version, owner);
284124
+ const ref = buildRef(featureName, version);
284243
284125
  featureArgs['traceability'] = {
284244
- version: reference,
284126
+ version,
284245
284127
  owner,
284246
284128
  repo,
284247
284129
  name: featureName,
284248
- ref: reference,
284249
- url: `https://github.com/${owner}/${repo}/tree/${reference}/packages/${featureName}`,
284130
+ ref,
284131
+ url: `https://github.com/${owner}/${repo}/tree/${ref}/packages/${featureName}`,
284250
284132
  };
284251
- return renderFeature(featureName, reference, featureOwner, '/tmp', featureArgs);
284133
+ return renderFeature(featureName, version, featureOwner, '/tmp', featureArgs);
284252
284134
  }
284253
284135
  async function prepareFeature(featureName, version, repo = 'features', owner = 'prefapp') {
284254
284136
  await downloadFeatureZip(repo, featureName, version, owner);
284255
284137
  }
284256
- async function downloadFeatureZip(repo, featureName, reference, owner = 'prefapp') {
284138
+ async function downloadFeatureZip(repo, featureName, version, owner = 'prefapp') {
284257
284139
  try {
284140
+ const ref = buildRef(featureName, version);
284258
284141
  const octokit = await github_0.getOctokitForOrg(owner);
284259
- const zipballExtractPath = catalog_common.features.tarballs.getFeaturesExtractPath(featureName, reference, { createIfNotExists: true });
284142
+ const zipballExtractPath = catalog_common.features.tarballs.getFeaturesExtractPath(featureName, version, { createIfNotExists: true });
284260
284143
  console.log(`Zipball extract path: ${zipballExtractPath}`);
284261
284144
  if (external_fs_.existsSync(zipballExtractPath)) {
284262
284145
  console.log(`Zipball extract path ${zipballExtractPath} already exists, removing it.`);
284263
284146
  external_fs_.rmSync(zipballExtractPath, { recursive: true });
284264
284147
  }
284265
- const response = await octokit.request('GET /repos/{owner}/{repo}/zipball/{reference}', {
284148
+ const response = await octokit.request('GET /repos/{owner}/{repo}/zipball/{ref}', {
284266
284149
  request: {
284267
284150
  parseSuccessResponseBody: false,
284268
284151
  },
284269
284152
  owner,
284270
284153
  repo,
284271
- reference,
284154
+ ref,
284272
284155
  });
284273
284156
  const randomZipTmpPath = `/tmp/${catalog_common.generic.randomString(20)}.zip`;
284274
- console.log(`Downloading feature ${featureName} version ${reference} to ${randomZipTmpPath}`);
284157
+ console.log(`Downloading feature ${featureName} version ${version} to ${randomZipTmpPath}`);
284275
284158
  if (external_fs_.existsSync(randomZipTmpPath)) {
284276
284159
  console.log(`Temporary zip file ${randomZipTmpPath} already exists, removing it.`);
284277
284160
  external_fs_.unlinkSync(randomZipTmpPath);
284278
284161
  }
284279
284162
  const randomExtractPath = `/tmp/${catalog_common.generic.randomString(20)}`;
284280
- console.log(`Extracting feature ${featureName} version ${reference} to ${randomExtractPath}`);
284281
- external_fs_.rmSync(randomExtractPath, { recursive: true, force: true });
284282
- await downloadZipBall(response.url, randomZipTmpPath);
284163
+ console.log(`Extracting feature ${featureName} version ${version} to ${randomExtractPath}`);
284164
+ await response.data;
284165
+ external_fs_.rmSync(randomZipTmpPath, { recursive: true, force: true });
284283
284166
  const zip = new (adm_zip_default())(randomZipTmpPath);
284284
284167
  const mainEntry = zip.getEntries()[0].entryName;
284285
284168
  console.log(`Main entry in zip: ${mainEntry}`);
@@ -284293,7 +284176,15 @@ async function downloadFeatureZip(repo, featureName, reference, owner = 'prefapp
284293
284176
  }
284294
284177
  catch (error) {
284295
284178
  console.error(error);
284296
- throw new Error(`Error for feature with tag ${reference}: ${error}. GitHub response: ${error}`);
284179
+ throw new Error(`Error for feature with tag ${featureName}-v${version}: ${error}. GitHub response: ${error}`);
284180
+ }
284181
+ }
284182
+ function buildRef(featureName, version) {
284183
+ if (IS_SEMVER_REF.test(version)) {
284184
+ return `${featureName}-v${version}`;
284185
+ }
284186
+ else {
284187
+ return `${version}`;
284297
284188
  }
284298
284189
  }
284299
284190
 
@@ -284302,7 +284193,6 @@ async function downloadFeatureZip(repo, featureName, reference, owner = 'prefapp
284302
284193
 
284303
284194
  /* harmony default export */ const features_preparer_src = ({
284304
284195
  renderFeature: renderFeature,
284305
- getFeatureConfigFromRef: getFeatureConfigFromRef,
284306
284196
  getFeatureConfig: getFeatureConfig,
284307
284197
  prepareFeature: prepareFeature,
284308
284198
  });
@@ -284314,7 +284204,6 @@ async function downloadFeatureZip(repo, featureName, reference, owner = 'prefapp
284314
284204
  prepareFeature: features_preparer_src.prepareFeature,
284315
284205
  renderFeature: features_preparer_src.renderFeature,
284316
284206
  getFeatureConfig: features_preparer_src.getFeatureConfig,
284317
- getFeatureConfigFromRef: features_preparer_src.getFeatureConfigFromRef,
284318
284207
  });
284319
284208
 
284320
284209
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/overriders/utils.ts
@@ -284359,17 +284248,13 @@ async function utils_renderFeature(featureName, featureVersion, featureOutputObj
284359
284248
 
284360
284249
 
284361
284250
  class FeaturesOverrider extends OverriderPatches {
284362
- constructor(featureName, featureVersion, featureConfig, featureArgs, featureRef, featureRepo) {
284251
+ constructor(featureName, featureVersion, featureConfig, featureArgs) {
284363
284252
  super();
284364
284253
  this.applicableProviders = ['github'];
284365
284254
  this.featureConfig = false;
284366
- this.featureRepo = '';
284367
- this.featureRef = '';
284368
284255
  this.featureName = featureName;
284369
284256
  this.featureVersion = featureVersion;
284370
284257
  this.featureArgs = featureArgs || {};
284371
- this.featureRef = featureRef || '';
284372
- this.featureRepo = featureRepo || '';
284373
284258
  if (featureConfig) {
284374
284259
  this.featureConfig = featureConfig;
284375
284260
  }
@@ -284377,32 +284262,15 @@ class FeaturesOverrider extends OverriderPatches {
284377
284262
  getFeatureConfig(cr) {
284378
284263
  if (this.featureConfig)
284379
284264
  return this.featureConfig;
284380
- return this.setUpAndRunRenderer(cr);
284381
- }
284382
- setUpAndRunRenderer(cr) {
284383
- let repo = 'features';
284384
- let owner = 'prefapp';
284385
- let versionOrRef = this.featureVersion;
284386
- let renderer = 'getFeatureConfig';
284387
- if (this.featureRepo) {
284388
- [owner, repo] = this.featureRepo.split(/\//);
284389
- }
284390
- if (this.featureRef) {
284391
- versionOrRef = this.featureRef;
284392
- renderer = 'getFeatureConfigFromRef';
284393
- }
284394
- return features_preparer[renderer](this.featureName, versionOrRef, cr, this.featureArgs, repo, owner);
284265
+ return features_preparer.getFeatureConfig(this.featureName, this.featureVersion, this.featureArgs, cr, 'features', 'prefapp');
284395
284266
  }
284396
284267
  async __validate() {
284397
284268
  return true;
284398
284269
  }
284399
284270
  async __patches(claim, _previousCR) {
284400
284271
  const featureName = this.featureName;
284401
- const featureVersion = this.featureVersion || this.featureRef;
284272
+ const featureVersion = this.featureVersion;
284402
284273
  const featureArgs = this.featureArgs;
284403
- const fSetUpAndRunRenderer = function (cr) {
284404
- return this.setUpAndRunRenderer(cr);
284405
- }.bind(this);
284406
284274
  let renderedFeatureConfig = null;
284407
284275
  return [
284408
284276
  {
@@ -284410,7 +284278,7 @@ class FeaturesOverrider extends OverriderPatches {
284410
284278
  return true;
284411
284279
  },
284412
284280
  async apply(cr) {
284413
- renderedFeatureConfig = await fSetUpAndRunRenderer(cr);
284281
+ renderedFeatureConfig = await features_preparer.getFeatureConfig(featureName, featureVersion, cr, featureArgs, 'features', 'prefapp');
284414
284282
  return cr;
284415
284283
  },
284416
284284
  identify() {
@@ -284456,7 +284324,7 @@ async function generateFeaturesPatches(claim) {
284456
284324
  return patches;
284457
284325
  }
284458
284326
  async function createRenderFeaturePatch(claim, feature) {
284459
- const featureOverrider = new FeaturesOverrider(feature.name, feature.version, false, feature.args, feature.ref, feature.repo);
284327
+ const featureOverrider = new FeaturesOverrider(feature.name, feature.version, false, feature.args);
284460
284328
  return featureOverrider.patches(claim, null);
284461
284329
  }
284462
284330
 
@@ -36,6 +36,5 @@ declare const _default: {
36
36
  TFWorkspaceClaimSchema: string;
37
37
  ArgoDeployClaimSchema: string;
38
38
  OrgWebhookClaimSchema: string;
39
- SecretsClaimSchema: string;
40
39
  };
41
40
  export default _default;
@@ -343,47 +343,6 @@ declare const schemas: {
343
343
  })[];
344
344
  };
345
345
  };
346
- } | {
347
- $schema: string;
348
- $id: string;
349
- definitions: {
350
- GithubComponentFeatureClaim: {
351
- $id: string;
352
- description: string;
353
- properties: {
354
- name: {
355
- type: string;
356
- description: string;
357
- };
358
- version: {
359
- type: string;
360
- description: string;
361
- };
362
- ref: {
363
- type: string;
364
- description: string;
365
- };
366
- args: {
367
- type: string;
368
- properties: {};
369
- additionalProperties: boolean;
370
- };
371
- repo: {
372
- type: string;
373
- description: string;
374
- pattern: string;
375
- };
376
- };
377
- required: string[];
378
- oneOf: {
379
- required: string[];
380
- not: {
381
- required: string[];
382
- };
383
- }[];
384
- additionalProperties: boolean;
385
- };
386
- };
387
346
  } | {
388
347
  $schema: string;
389
348
  $id: string;
@@ -408,12 +367,6 @@ declare const schemas: {
408
367
  type: string;
409
368
  enum: string[];
410
369
  };
411
- features: {
412
- type: string;
413
- items: {
414
- $ref: string;
415
- };
416
- };
417
370
  };
418
371
  required: string[];
419
372
  $ref?: undefined;
@@ -22,12 +22,6 @@ declare const _default: {
22
22
  type: string;
23
23
  enum: string[];
24
24
  };
25
- features: {
26
- type: string;
27
- items: {
28
- $ref: string;
29
- };
30
- };
31
25
  };
32
26
  required: string[];
33
27
  $ref?: undefined;
@@ -59,47 +59,6 @@ export declare const GithubSchemas: ({
59
59
  })[];
60
60
  };
61
61
  };
62
- } | {
63
- $schema: string;
64
- $id: string;
65
- definitions: {
66
- GithubComponentFeatureClaim: {
67
- $id: string;
68
- description: string;
69
- properties: {
70
- name: {
71
- type: string;
72
- description: string;
73
- };
74
- version: {
75
- type: string;
76
- description: string;
77
- };
78
- ref: {
79
- type: string;
80
- description: string;
81
- };
82
- args: {
83
- type: string;
84
- properties: {};
85
- additionalProperties: boolean;
86
- };
87
- repo: {
88
- type: string;
89
- description: string;
90
- pattern: string;
91
- };
92
- };
93
- required: string[];
94
- oneOf: {
95
- required: string[];
96
- not: {
97
- required: string[];
98
- };
99
- }[];
100
- additionalProperties: boolean;
101
- };
102
- };
103
62
  } | {
104
63
  $schema: string;
105
64
  $id: string;
@@ -124,12 +83,6 @@ export declare const GithubSchemas: ({
124
83
  type: string;
125
84
  enum: string[];
126
85
  };
127
- features: {
128
- type: string;
129
- items: {
130
- $ref: string;
131
- };
132
- };
133
86
  };
134
87
  required: string[];
135
88
  $ref?: undefined;
@@ -13,9 +13,7 @@ export interface IGithubRepositoryFeatureClaim extends IClaim {
13
13
  context: any;
14
14
  feature: {
15
15
  name: string;
16
- version?: string;
17
- ref?: string;
18
- repo?: string;
16
+ version: string;
19
17
  };
20
18
  repositoryTarget: FirestartrGithubRepositoryFeatureSpecRepositoryTarget;
21
19
  files: Array<IGithubRepositoryFeatureFileClaim>;
@@ -5,11 +5,8 @@ export declare class FeaturesOverrider extends OverriderPatches {
5
5
  private featureVersion;
6
6
  private featureConfig;
7
7
  private featureArgs;
8
- private featureRepo;
9
- private featureRef;
10
- constructor(featureName: string, featureVersion: string, featureConfig?: any, featureArgs?: any, featureRef?: string, featureRepo?: string);
8
+ constructor(featureName: string, featureVersion: string, featureConfig?: any, featureArgs?: any);
11
9
  getFeatureConfig(cr: any): any;
12
- setUpAndRunRenderer(cr: any): any;
13
10
  __validate(): Promise<boolean>;
14
11
  __patches(claim: any, _previousCR: any): Promise<({
15
12
  validate(_cr: any): boolean;
@@ -3,6 +3,5 @@ declare const _default: {
3
3
  prepareFeature: typeof import("./src/installer").prepareFeature;
4
4
  renderFeature: typeof import("./src/renderer").renderFeature;
5
5
  getFeatureConfig: typeof import("./src/installer").getFeatureConfig;
6
- getFeatureConfigFromRef: typeof import("./src/installer").getFeatureConfigFromRef;
7
6
  };
8
7
  export default _default;
@@ -1,8 +1,7 @@
1
- import { getFeatureConfigFromRef, getFeatureConfig, prepareFeature } from './installer';
1
+ import { getFeatureConfig, prepareFeature } from './installer';
2
2
  import { renderFeature } from './renderer';
3
3
  declare const _default: {
4
4
  renderFeature: typeof renderFeature;
5
- getFeatureConfigFromRef: typeof getFeatureConfigFromRef;
6
5
  getFeatureConfig: typeof getFeatureConfig;
7
6
  prepareFeature: typeof prepareFeature;
8
7
  };
@@ -1,6 +1,4 @@
1
- export declare function getFeatureConfigFromRef(featureName: string, featureRef: string, featureOwner: any, // -> cr
2
- featureArgs?: any, repo?: string, owner?: string): Promise<any>;
3
1
  export declare function getFeatureConfig(featureName: string, version: string, featureOwner: any, // -> cr
4
2
  featureArgs?: any, repo?: string, owner?: string): Promise<any>;
5
3
  export declare function prepareFeature(featureName: string, version: string, repo?: string, owner?: string): Promise<void>;
6
- export declare function downloadFeatureZip(repo: string, featureName: string, reference: string, owner?: string): Promise<string>;
4
+ export declare function downloadFeatureZip(repo: string, featureName: string, version: string, owner?: string): Promise<string>;
@@ -428,7 +428,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
428
428
  verified_at: string;
429
429
  };
430
430
  };
431
- author: {
431
+ author: Record<string, never> | {
432
432
  name?: string;
433
433
  email?: string;
434
434
  login: string;
@@ -451,8 +451,8 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
451
451
  site_admin: boolean;
452
452
  starred_at?: string;
453
453
  user_view_type?: string;
454
- } | Record<string, never>;
455
- committer: {
454
+ };
455
+ committer: Record<string, never> | {
456
456
  name?: string;
457
457
  email?: string;
458
458
  login: string;
@@ -475,7 +475,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
475
475
  site_admin: boolean;
476
476
  starred_at?: string;
477
477
  user_view_type?: string;
478
- } | Record<string, never>;
478
+ };
479
479
  parents: {
480
480
  sha: string;
481
481
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.43.1",
3
+ "version": "1.43.2-snapshot-2",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",
@@ -1,9 +0,0 @@
1
- import { IClaim } from '../base';
2
- export interface ISecretsClaim extends IClaim {
3
- type: string;
4
- lifecycle: string;
5
- system: string;
6
- name: string;
7
- providers: any;
8
- }
9
- export declare const schema = "firestartr.dev://common/SecretsClaim";
@@ -1,43 +0,0 @@
1
- declare const _default: {
2
- $schema: string;
3
- $id: string;
4
- definitions: {
5
- GithubComponentFeatureClaim: {
6
- $id: string;
7
- description: string;
8
- properties: {
9
- name: {
10
- type: string;
11
- description: string;
12
- };
13
- version: {
14
- type: string;
15
- description: string;
16
- };
17
- ref: {
18
- type: string;
19
- description: string;
20
- };
21
- args: {
22
- type: string;
23
- properties: {};
24
- additionalProperties: boolean;
25
- };
26
- repo: {
27
- type: string;
28
- description: string;
29
- pattern: string;
30
- };
31
- };
32
- required: string[];
33
- oneOf: {
34
- required: string[];
35
- not: {
36
- required: string[];
37
- };
38
- }[];
39
- additionalProperties: boolean;
40
- };
41
- };
42
- };
43
- export default _default;
@@ -1 +0,0 @@
1
- export declare function downloadZipBall(url: string, filePath: string): Promise<void>;