@firestartr/cli 1.49.0-snapshot-7 → 1.49.0-snapshot-9

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
@@ -165028,7 +165028,7 @@ __exportStar(__nccwpck_require__(58898), exports);
165028
165028
  __exportStar(__nccwpck_require__(17419), exports);
165029
165029
  __exportStar(__nccwpck_require__(70161), exports);
165030
165030
  __exportStar(__nccwpck_require__(55079), exports);
165031
- __exportStar(__nccwpck_require__(99515), exports);
165031
+ __exportStar(__nccwpck_require__(39477), exports);
165032
165032
  __exportStar(__nccwpck_require__(34311), exports);
165033
165033
  __exportStar(__nccwpck_require__(88740), exports);
165034
165034
  __exportStar(__nccwpck_require__(15023), exports);
@@ -166666,7 +166666,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
166666
166666
  exports.TerraformModule = void 0;
166667
166667
  const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
166668
166668
  const terraform_element_1 = __nccwpck_require__(70161);
166669
- const terraform_provider_1 = __nccwpck_require__(99515);
166669
+ const terraform_provider_1 = __nccwpck_require__(39477);
166670
166670
  const util_1 = __nccwpck_require__(79751);
166671
166671
  const tokens_1 = __nccwpck_require__(58898);
166672
166672
  const tfExpression_1 = __nccwpck_require__(75754);
@@ -166985,7 +166985,7 @@ TerraformOutput[_a] = { fqn: "cdktf.TerraformOutput", version: "0.19.2" };
166985
166985
 
166986
166986
  /***/ }),
166987
166987
 
166988
- /***/ 99515:
166988
+ /***/ 39477:
166989
166989
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
166990
166990
 
166991
166991
 
@@ -167539,7 +167539,7 @@ const constructs_1 = __nccwpck_require__(38794);
167539
167539
  const _tokens_1 = __nccwpck_require__(9074);
167540
167540
  const terraform_element_1 = __nccwpck_require__(70161);
167541
167541
  const util_1 = __nccwpck_require__(79751);
167542
- const terraform_provider_1 = __nccwpck_require__(99515);
167542
+ const terraform_provider_1 = __nccwpck_require__(39477);
167543
167543
  const local_backend_1 = __nccwpck_require__(31797);
167544
167544
  const tfExpression_1 = __nccwpck_require__(75754);
167545
167545
  const terraform_output_1 = __nccwpck_require__(15023);
@@ -170929,7 +170929,7 @@ exports.ValidateProviderPresence = void 0;
170929
170929
  // Copyright (c) HashiCorp, Inc
170930
170930
  // SPDX-License-Identifier: MPL-2.0
170931
170931
  const constructs_1 = __nccwpck_require__(38794);
170932
- const terraform_provider_1 = __nccwpck_require__(99515);
170932
+ const terraform_provider_1 = __nccwpck_require__(39477);
170933
170933
  const terraform_resource_1 = __nccwpck_require__(34311);
170934
170934
  const terraform_data_source_1 = __nccwpck_require__(88740);
170935
170935
  const terraform_stack_1 = __nccwpck_require__(17419);
@@ -298091,6 +298091,7 @@ async function createOrphanBranch(repo, branch, owner = 'prefapp') {
298091
298091
  ;// CONCATENATED MODULE: ../github/src/check_run.ts
298092
298092
 
298093
298093
 
298094
+
298094
298095
  const FLUSH_TIMEOUT = 4; // seconds
298095
298096
  const GITHUB_OUTPUT_TEXT_LIMIT = 65000; // ~65k hard limit for output.text
298096
298097
  /**
@@ -298227,6 +298228,9 @@ class GithubCheckRun {
298227
298228
  });
298228
298229
  this.closed = true;
298229
298230
  }
298231
+ catch (e) {
298232
+ github_src_logger.error(e);
298233
+ }
298230
298234
  finally {
298231
298235
  this.closing = false;
298232
298236
  }
@@ -299357,6 +299361,25 @@ function resolveCodeownersRef(ref, org) {
299357
299361
  }
299358
299362
  return result;
299359
299363
  }
299364
+ const IS_SECRET_REF = new RegExp(/^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$/);
299365
+ function isRepoSecretRef(suspectedRef) {
299366
+ return IS_SECRET_REF.test(suspectedRef);
299367
+ }
299368
+ function extractRepoSecretRef(ref) {
299369
+ if (!IS_SECRET_REF.test(ref)) {
299370
+ throw new Error(`extractRepoSecretRef: ref not valid ${ref}`);
299371
+ }
299372
+ const parts = ref.split(':');
299373
+ const secretKind = parts[1];
299374
+ if (secretKind !== 'secretsclaim') {
299375
+ throw new Error(`extractRepoSecretRef: Invalid secret kind ${secretKind}`);
299376
+ }
299377
+ return {
299378
+ kind: secretKind,
299379
+ name: parts[2],
299380
+ key: parts[3],
299381
+ };
299382
+ }
299360
299383
 
299361
299384
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/overriders/base.ts
299362
299385
 
@@ -300682,6 +300705,7 @@ const NORMALIZERS = [
300682
300705
 
300683
300706
 
300684
300707
 
300708
+
300685
300709
  const kindMap = {
300686
300710
  user: 'UserClaim',
300687
300711
  group: 'GroupClaim',
@@ -300735,6 +300759,11 @@ function extractAllRefs(claimData) {
300735
300759
  refs.push(...groupRefs);
300736
300760
  break;
300737
300761
  }
300762
+ case 'ComponentClaim': {
300763
+ const secretsRefs = getComponentVarsAndSecretsRefs(parsedClaim);
300764
+ refs.push(...secretsRefs);
300765
+ break;
300766
+ }
300738
300767
  }
300739
300768
  cdk8s_renderer_src_logger.info(`Refs for ${parsedClaim.kind}-${parsedClaim.name}: ${[...new Set(refs)].join(',')}`);
300740
300769
  return [...new Set(refs)];
@@ -300781,6 +300810,33 @@ function getTfWorkspacesRefs(values, references = []) {
300781
300810
  }
300782
300811
  return references;
300783
300812
  }
300813
+ function getComponentVarsAndSecretsRefs(parsedClaim) {
300814
+ const refs = {};
300815
+ const githubProvider = parsedClaim.providers?.github;
300816
+ if (githubProvider) {
300817
+ const varsBlock = githubProvider.vars;
300818
+ const secretsBlock = githubProvider.secrets;
300819
+ if (varsBlock) {
300820
+ for (const block of Object.keys(varsBlock)) {
300821
+ for (const refVar of varsBlock[block]) {
300822
+ if (isRepoSecretRef(refVar.value)) {
300823
+ const secretRef = extractRepoSecretRef(refVar.value);
300824
+ refs[`SecretsClaim-${secretRef.name}`] = true;
300825
+ }
300826
+ }
300827
+ }
300828
+ }
300829
+ if (secretsBlock) {
300830
+ for (const block of Object.keys(secretsBlock)) {
300831
+ for (const secret of secretsBlock[block]) {
300832
+ const secretRef = extractRepoSecretRef(secret.value);
300833
+ refs[`SecretsClaim-${secretRef.name}`] = true;
300834
+ }
300835
+ }
300836
+ }
300837
+ }
300838
+ return Object.keys(refs);
300839
+ }
300784
300840
  function getClaimReferences(claim) {
300785
300841
  const headerRegex = catalog_common.types.regex.YAMLHeaderRegex;
300786
300842
  const multilineRegex = catalog_common.types.regex.YAMLMultilineRegex;
@@ -301555,7 +301611,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
301555
301611
  $id: 'firestartr.dev://github/GithubComponentClaimSecretRef',
301556
301612
  type: 'string',
301557
301613
  description: 'the reference of the secret',
301558
- pattern: '^ref:secretclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$',
301614
+ pattern: '^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$',
301559
301615
  },
301560
301616
  GithubComponentClaimRepoSecret: {
301561
301617
  $id: 'firestartr.dev://github/GithubComponentClaimRepoSecret',
@@ -302611,15 +302667,20 @@ function validatePermissionsUniqueness(crs) {
302611
302667
  const permissions = cr.spec.permissions;
302612
302668
  cdk8s_renderer_src_logger.debug(`Validating Permissions Uniqueness of ${crkey}`);
302613
302669
  if (permissions) {
302614
- const seen = new Set();
302670
+ const rolesByIdentifier = new Map();
302615
302671
  for (const perm of permissions) {
302616
302672
  const identifier = perm.collaborator
302617
302673
  ? perm.collaborator
302618
302674
  : `ref:${perm.ref.kind}:${perm.ref.name}`;
302619
- if (seen.has(identifier)) {
302620
- throw new Error(`Duplicate permission reference found in FirestartrGithubRepository ${crkey}: ${identifier}\nFull CR: ${JSON.stringify(cr, null, 2)}`);
302675
+ const role = perm.role;
302676
+ if (rolesByIdentifier.has(identifier)) {
302677
+ const prevRole = rolesByIdentifier.get(identifier);
302678
+ if (prevRole !== role) {
302679
+ throw new Error(`Conflicting permission role in FirestartrGithubRepository ${crkey}: ${identifier} has roles "${prevRole}" and "${role}".\nFull CR: ${JSON.stringify(cr, null, 2)}`);
302680
+ }
302681
+ continue;
302621
302682
  }
302622
- seen.add(identifier);
302683
+ rolesByIdentifier.set(identifier, role);
302623
302684
  }
302624
302685
  }
302625
302686
  }
@@ -305318,6 +305379,8 @@ function toJson_FirestartrGithubRepositorySpec(obj) {
305318
305379
  'actions': toJson_FirestartrGithubRepositorySpecActions(obj.actions),
305319
305380
  'pages': toJson_FirestartrGithubRepositorySpecPages(obj.pages),
305320
305381
  'permissions': obj.permissions?.map(y => toJson_FirestartrGithubRepositorySpecPermissions(y)),
305382
+ 'secrets': toJson_FirestartrGithubRepositorySpecSecrets(obj.secrets),
305383
+ 'vars': toJson_FirestartrGithubRepositorySpecVars(obj.vars),
305321
305384
  'branchProtections': obj.branchProtections?.map(y => toJson_FirestartrGithubRepositorySpecBranchProtections(y)),
305322
305385
  'writeConnectionSecretToRef': toJson_FirestartrGithubRepositorySpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
305323
305386
  };
@@ -305428,6 +305491,39 @@ function toJson_FirestartrGithubRepositorySpecPermissions(obj) {
305428
305491
  // filter undefined values
305429
305492
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305430
305493
  }
305494
+ /**
305495
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecrets' to JSON representation.
305496
+ */
305497
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305498
+ function toJson_FirestartrGithubRepositorySpecSecrets(obj) {
305499
+ if (obj === undefined) {
305500
+ return undefined;
305501
+ }
305502
+ const result = {
305503
+ 'actions': obj.actions?.map(y => toJson_FirestartrGithubRepositorySpecSecretsActions(y)),
305504
+ 'codespaces': obj.codespaces?.map(y => toJson_FirestartrGithubRepositorySpecSecretsCodespaces(y)),
305505
+ 'copilot': obj.copilot?.map(y => toJson_FirestartrGithubRepositorySpecSecretsCopilot(y)),
305506
+ };
305507
+ // filter undefined values
305508
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305509
+ }
305510
+ /**
305511
+ * Converts an object of type 'FirestartrGithubRepositorySpecVars' to JSON representation.
305512
+ */
305513
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305514
+ function toJson_FirestartrGithubRepositorySpecVars(obj) {
305515
+ if (obj === undefined) {
305516
+ return undefined;
305517
+ }
305518
+ const result = {
305519
+ 'variableItemSchema': toJson_FirestartrGithubRepositorySpecVarsVariableItemSchema(obj.variableItemSchema),
305520
+ 'actions': obj.actions?.map(y => toJson_FirestartrGithubRepositorySpecVarsActions(y)),
305521
+ 'dependabot': obj.dependabot?.map(y => toJson_FirestartrGithubRepositorySpecVarsDependabot(y)),
305522
+ 'codespaces': obj.codespaces?.map(y => toJson_FirestartrGithubRepositorySpecVarsCodespaces(y)),
305523
+ };
305524
+ // filter undefined values
305525
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305526
+ }
305431
305527
  /**
305432
305528
  * Converts an object of type 'FirestartrGithubRepositorySpecBranchProtections' to JSON representation.
305433
305529
  */
@@ -305580,6 +305676,115 @@ function toJson_FirestartrGithubRepositorySpecPermissionsRef(obj) {
305580
305676
  // filter undefined values
305581
305677
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305582
305678
  }
305679
+ /**
305680
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsActions' to JSON representation.
305681
+ */
305682
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305683
+ function toJson_FirestartrGithubRepositorySpecSecretsActions(obj) {
305684
+ if (obj === undefined) {
305685
+ return undefined;
305686
+ }
305687
+ const result = {
305688
+ 'name': obj.name,
305689
+ 'ref': toJson_FirestartrGithubRepositorySpecSecretsActionsRef(obj.ref),
305690
+ };
305691
+ // filter undefined values
305692
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305693
+ }
305694
+ /**
305695
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsCodespaces' to JSON representation.
305696
+ */
305697
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305698
+ function toJson_FirestartrGithubRepositorySpecSecretsCodespaces(obj) {
305699
+ if (obj === undefined) {
305700
+ return undefined;
305701
+ }
305702
+ const result = {
305703
+ 'name': obj.name,
305704
+ 'ref': toJson_FirestartrGithubRepositorySpecSecretsCodespacesRef(obj.ref),
305705
+ };
305706
+ // filter undefined values
305707
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305708
+ }
305709
+ /**
305710
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsCopilot' to JSON representation.
305711
+ */
305712
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305713
+ function toJson_FirestartrGithubRepositorySpecSecretsCopilot(obj) {
305714
+ if (obj === undefined) {
305715
+ return undefined;
305716
+ }
305717
+ const result = {
305718
+ 'name': obj.name,
305719
+ 'ref': toJson_FirestartrGithubRepositorySpecSecretsCopilotRef(obj.ref),
305720
+ };
305721
+ // filter undefined values
305722
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305723
+ }
305724
+ /**
305725
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsVariableItemSchema' to JSON representation.
305726
+ */
305727
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305728
+ function toJson_FirestartrGithubRepositorySpecVarsVariableItemSchema(obj) {
305729
+ if (obj === undefined) {
305730
+ return undefined;
305731
+ }
305732
+ const result = {
305733
+ 'name': obj.name,
305734
+ 'value': obj.value,
305735
+ 'ref': toJson_FirestartrGithubRepositorySpecVarsVariableItemSchemaRef(obj.ref),
305736
+ };
305737
+ // filter undefined values
305738
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305739
+ }
305740
+ /**
305741
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsActions' to JSON representation.
305742
+ */
305743
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305744
+ function toJson_FirestartrGithubRepositorySpecVarsActions(obj) {
305745
+ if (obj === undefined) {
305746
+ return undefined;
305747
+ }
305748
+ const result = {
305749
+ 'name': obj.name,
305750
+ 'value': obj.value,
305751
+ 'ref': toJson_FirestartrGithubRepositorySpecVarsActionsRef(obj.ref),
305752
+ };
305753
+ // filter undefined values
305754
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305755
+ }
305756
+ /**
305757
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsDependabot' to JSON representation.
305758
+ */
305759
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305760
+ function toJson_FirestartrGithubRepositorySpecVarsDependabot(obj) {
305761
+ if (obj === undefined) {
305762
+ return undefined;
305763
+ }
305764
+ const result = {
305765
+ 'name': obj.name,
305766
+ 'value': obj.value,
305767
+ 'ref': toJson_FirestartrGithubRepositorySpecVarsDependabotRef(obj.ref),
305768
+ };
305769
+ // filter undefined values
305770
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305771
+ }
305772
+ /**
305773
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsCodespaces' to JSON representation.
305774
+ */
305775
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305776
+ function toJson_FirestartrGithubRepositorySpecVarsCodespaces(obj) {
305777
+ if (obj === undefined) {
305778
+ return undefined;
305779
+ }
305780
+ const result = {
305781
+ 'name': obj.name,
305782
+ 'value': obj.value,
305783
+ 'ref': toJson_FirestartrGithubRepositorySpecVarsCodespacesRef(obj.ref),
305784
+ };
305785
+ // filter undefined values
305786
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305787
+ }
305583
305788
  /**
305584
305789
  * Converts an object of type 'FirestartrGithubRepositorySpecWriteConnectionSecretToRefOutputs' to JSON representation.
305585
305790
  */
@@ -305624,6 +305829,118 @@ function toJson_FirestartrGithubRepositorySpecContextProviderRef(obj) {
305624
305829
  // filter undefined values
305625
305830
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305626
305831
  }
305832
+ /**
305833
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsActionsRef' to JSON representation.
305834
+ */
305835
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305836
+ function toJson_FirestartrGithubRepositorySpecSecretsActionsRef(obj) {
305837
+ if (obj === undefined) {
305838
+ return undefined;
305839
+ }
305840
+ const result = {
305841
+ 'kind': obj.kind,
305842
+ 'name': obj.name,
305843
+ 'key': obj.key,
305844
+ };
305845
+ // filter undefined values
305846
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305847
+ }
305848
+ /**
305849
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsCodespacesRef' to JSON representation.
305850
+ */
305851
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305852
+ function toJson_FirestartrGithubRepositorySpecSecretsCodespacesRef(obj) {
305853
+ if (obj === undefined) {
305854
+ return undefined;
305855
+ }
305856
+ const result = {
305857
+ 'kind': obj.kind,
305858
+ 'name': obj.name,
305859
+ 'key': obj.key,
305860
+ };
305861
+ // filter undefined values
305862
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305863
+ }
305864
+ /**
305865
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsCopilotRef' to JSON representation.
305866
+ */
305867
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305868
+ function toJson_FirestartrGithubRepositorySpecSecretsCopilotRef(obj) {
305869
+ if (obj === undefined) {
305870
+ return undefined;
305871
+ }
305872
+ const result = {
305873
+ 'kind': obj.kind,
305874
+ 'name': obj.name,
305875
+ 'key': obj.key,
305876
+ };
305877
+ // filter undefined values
305878
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305879
+ }
305880
+ /**
305881
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsVariableItemSchemaRef' to JSON representation.
305882
+ */
305883
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305884
+ function toJson_FirestartrGithubRepositorySpecVarsVariableItemSchemaRef(obj) {
305885
+ if (obj === undefined) {
305886
+ return undefined;
305887
+ }
305888
+ const result = {
305889
+ 'kind': obj.kind,
305890
+ 'name': obj.name,
305891
+ 'key': obj.key,
305892
+ };
305893
+ // filter undefined values
305894
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305895
+ }
305896
+ /**
305897
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsActionsRef' to JSON representation.
305898
+ */
305899
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305900
+ function toJson_FirestartrGithubRepositorySpecVarsActionsRef(obj) {
305901
+ if (obj === undefined) {
305902
+ return undefined;
305903
+ }
305904
+ const result = {
305905
+ 'kind': obj.kind,
305906
+ 'name': obj.name,
305907
+ 'key': obj.key,
305908
+ };
305909
+ // filter undefined values
305910
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305911
+ }
305912
+ /**
305913
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsDependabotRef' to JSON representation.
305914
+ */
305915
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305916
+ function toJson_FirestartrGithubRepositorySpecVarsDependabotRef(obj) {
305917
+ if (obj === undefined) {
305918
+ return undefined;
305919
+ }
305920
+ const result = {
305921
+ 'kind': obj.kind,
305922
+ 'name': obj.name,
305923
+ 'key': obj.key,
305924
+ };
305925
+ // filter undefined values
305926
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305927
+ }
305928
+ /**
305929
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsCodespacesRef' to JSON representation.
305930
+ */
305931
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305932
+ function toJson_FirestartrGithubRepositorySpecVarsCodespacesRef(obj) {
305933
+ if (obj === undefined) {
305934
+ return undefined;
305935
+ }
305936
+ const result = {
305937
+ 'kind': obj.kind,
305938
+ 'name': obj.name,
305939
+ 'key': obj.key,
305940
+ };
305941
+ // filter undefined values
305942
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
305943
+ }
305627
305944
  /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
305628
305945
  /**
305629
305946
  * @schema FirestartrGithubRepositorySpecContextBackendRefKind
@@ -306966,6 +307283,8 @@ class GithubRepositoryChart extends BaseGithubChart {
306966
307283
  },
306967
307284
  actions,
306968
307285
  permissions: this.createPermissions(claim),
307286
+ vars: this.createVars(claim),
307287
+ secrets: this.createRepoSecrets(claim),
306969
307288
  pages: claim.providers.github.pages,
306970
307289
  branchProtections: [],
306971
307290
  writeConnectionSecretToRef: {
@@ -307037,6 +307356,87 @@ class GithubRepositoryChart extends BaseGithubChart {
307037
307356
  }
307038
307357
  return permissions;
307039
307358
  }
307359
+ /**
307360
+ * @description This method creates the vars data for the repository
307361
+ * @param claim
307362
+ * @returns VarsConfiguration
307363
+ */
307364
+ createVars(claim) {
307365
+ const vars = {};
307366
+ const varsDefinition = claim.providers?.github?.vars;
307367
+ if (varsDefinition) {
307368
+ if (varsDefinition.actions) {
307369
+ vars.actions = this.formatVars(varsDefinition.actions);
307370
+ }
307371
+ if (varsDefinition.codespaces) {
307372
+ vars.codespaces = this.formatVars(varsDefinition.codespaces);
307373
+ }
307374
+ if (varsDefinition.copilot) {
307375
+ vars.copilot = this.formatVars(varsDefinition.copilot);
307376
+ }
307377
+ }
307378
+ return vars;
307379
+ }
307380
+ /**
307381
+ * @description This method creates the secrets data for the repository
307382
+ * @param claim
307383
+ * @returns RepoSecretsConfiguration
307384
+ */
307385
+ createRepoSecrets(claim) {
307386
+ const repoSecrets = {};
307387
+ const repoSecretsDefinitions = claim.providers?.github?.secrets;
307388
+ if (repoSecretsDefinitions) {
307389
+ if (repoSecretsDefinitions.actions) {
307390
+ repoSecrets.actions = this.formatRepoSecrets(repoSecretsDefinitions.actions);
307391
+ }
307392
+ if (repoSecretsDefinitions.codespaces) {
307393
+ repoSecrets.codespaces = this.formatRepoSecrets(repoSecretsDefinitions.codespaces);
307394
+ }
307395
+ if (repoSecretsDefinitions.copilot) {
307396
+ repoSecrets.copilot = this.formatRepoSecrets(repoSecretsDefinitions.copilot);
307397
+ }
307398
+ }
307399
+ return repoSecrets;
307400
+ }
307401
+ formatVars(blockDefinition) {
307402
+ return blockDefinition.map((varDef) => {
307403
+ if (isRepoSecretRef(varDef.value)) {
307404
+ const parts = varDef.value.split(':');
307405
+ return {
307406
+ name: varDef.name,
307407
+ ref: {
307408
+ kind: 'Secret',
307409
+ name: parts[2],
307410
+ key: parts[3],
307411
+ },
307412
+ };
307413
+ }
307414
+ else {
307415
+ return {
307416
+ name: varDef.name,
307417
+ value: varDef.value,
307418
+ };
307419
+ }
307420
+ });
307421
+ }
307422
+ formatRepoSecrets(blockDefinition) {
307423
+ return blockDefinition.map((secretDef) => {
307424
+ if (isRepoSecretRef(secretDef.value)) {
307425
+ const parts = secretDef.value.split(':');
307426
+ return {
307427
+ name: secretDef.name,
307428
+ ref: {
307429
+ kind: 'Secret',
307430
+ name: parts[2],
307431
+ key: parts[3],
307432
+ },
307433
+ };
307434
+ }
307435
+ else {
307436
+ throw new Error(`RepoSecret value is not correct: ${secretDef.value}`);
307437
+ }
307438
+ });
307439
+ }
307040
307440
  extraCharts() {
307041
307441
  return this.get('features') || [];
307042
307442
  }
@@ -314647,6 +315047,40 @@ function tf_checkrun_extractPrInfo(item) {
314647
315047
  return { prNumber, repo, org };
314648
315048
  }
314649
315049
 
315050
+ ;// CONCATENATED MODULE: ../operator/src/utils/index.ts
315051
+ const secretRegex = /\$\{\{ secrets\.(.*?) \}\}/g;
315052
+ function replaceConfigSecrets(config, secrets) {
315053
+ for (const key in config) {
315054
+ if (typeof config[key] === 'object' && config[key] !== null) {
315055
+ // If the property is an object, call this function recursively
315056
+ replaceConfigSecrets(config[key], secrets);
315057
+ }
315058
+ else if (typeof config[key] === 'string') {
315059
+ // If the property is a string and its value is equal to secrets.something,
315060
+ // replace the value with the value of the 'something' key in the secrets object
315061
+ config[key] = config[key].replace(secretRegex, (_, group1) => {
315062
+ if (!secrets[group1]) {
315063
+ throw new Error(`Secret ${group1} not found in secrets`);
315064
+ }
315065
+ return secrets[group1];
315066
+ });
315067
+ }
315068
+ }
315069
+ return config;
315070
+ }
315071
+ function replaceInlineSecrets(inline, secrets) {
315072
+ if (typeof inline !== 'string' || !inline)
315073
+ return inline;
315074
+ let result = inline;
315075
+ result = result.replace(secretRegex, (_, group1) => {
315076
+ if (!secrets[group1]) {
315077
+ throw new Error(`Secret ${group1} not found in secrets`);
315078
+ }
315079
+ return secrets[group1];
315080
+ });
315081
+ return result;
315082
+ }
315083
+
314650
315084
  ;// CONCATENATED MODULE: ../operator/src/tfworkspaces/process-operation.ts
314651
315085
 
314652
315086
 
@@ -314658,6 +315092,7 @@ function tf_checkrun_extractPrInfo(item) {
314658
315092
 
314659
315093
 
314660
315094
 
315095
+
314661
315096
  const TF_PROJECTS_PATH = '/tmp/tfworkspaces';
314662
315097
  function process_operation_processOperation(item, op, handler) {
314663
315098
  try {
@@ -315223,25 +315658,6 @@ function getRefContextFromCr(cr, deps) {
315223
315658
  }
315224
315659
  return secrets;
315225
315660
  }
315226
- function replaceConfigSecrets(config, secrets) {
315227
- for (const key in config) {
315228
- if (typeof config[key] === 'object' && config[key] !== null) {
315229
- // If the property is an object, call this function recursively
315230
- replaceConfigSecrets(config[key], secrets);
315231
- }
315232
- else if (typeof config[key] === 'string') {
315233
- // If the property is a string and its value is equal to secrets.something,
315234
- // replace the value with the value of the 'something' key in the secrets object
315235
- config[key] = config[key].replace(/\$\{\{ secrets\.(.*?) \}\}/g, (_, group1) => {
315236
- if (!secrets[group1]) {
315237
- throw new Error(`Secret ${group1} not found in secrets`);
315238
- }
315239
- return secrets[group1];
315240
- });
315241
- }
315242
- }
315243
- return config;
315244
- }
315245
315661
  function adaptProviders(item, deps) {
315246
315662
  const result = {};
315247
315663
  result['secrets'] = [];
@@ -315266,10 +315682,11 @@ function adaptProvider(providerFromItem, deps) {
315266
315682
  const providerDependency = deps[providerName].cr;
315267
315683
  const providerSecrets = getRefContextFromCr(providerDependency, deps);
315268
315684
  const providerConfigData = replaceConfigSecrets(JSON.parse(providerDependency.spec.config), providerSecrets);
315685
+ const providerInlineData = replaceInlineSecrets(providerDependency.spec.inline, providerSecrets);
315269
315686
  provider['name'] = providerDependency.spec.type;
315270
315687
  provider['version'] = providerDependency.spec.version;
315271
315688
  provider['source'] = providerDependency.spec.source;
315272
- provider['inline'] = providerDependency.spec.inline;
315689
+ provider['inline'] = providerInlineData;
315273
315690
  provider['config'] = providerConfigData;
315274
315691
  const secrets = [];
315275
315692
  if (providerDependency.spec.env) {
@@ -315294,8 +315711,10 @@ function adaptBackend(item, deps) {
315294
315711
  const backendDependency = deps[backendName].cr;
315295
315712
  const backendSecrets = getRefContextFromCr(backendDependency, deps);
315296
315713
  const providerConfigData = replaceConfigSecrets(JSON.parse(backendDependency.spec.config), backendSecrets);
315714
+ const providerInlineData = replaceInlineSecrets(backendDependency.spec.inline, backendSecrets);
315297
315715
  backend[backendDependency.spec.type] = {};
315298
315716
  backend[backendDependency.spec.type]['config'] = providerConfigData;
315717
+ backend[backendDependency.spec.type]['inline'] = providerInlineData;
315299
315718
  return backend;
315300
315719
  }
315301
315720
  /**
@@ -315503,6 +315922,7 @@ async function acquireLease(namespace, cb, interval = 10000) {
315503
315922
 
315504
315923
 
315505
315924
 
315925
+
315506
315926
  const processOperationPlan_TF_PROJECTS_PATH = '/tmp/tfworkspaces';
315507
315927
  function processOperationPlan(item, op, handler) {
315508
315928
  try {
@@ -315797,25 +316217,6 @@ function processOperationPlan_getRefContextFromCr(cr, deps) {
315797
316217
  }
315798
316218
  return secrets;
315799
316219
  }
315800
- function processOperationPlan_replaceConfigSecrets(config, secrets) {
315801
- for (const key in config) {
315802
- if (typeof config[key] === 'object' && config[key] !== null) {
315803
- // If the property is an object, call this function recursively
315804
- processOperationPlan_replaceConfigSecrets(config[key], secrets);
315805
- }
315806
- else if (typeof config[key] === 'string') {
315807
- // If the property is a string and its value is equal to secrets.something,
315808
- // replace the value with the value of the 'something' key in the secrets object
315809
- config[key] = config[key].replace(/\$\{\{ secrets\.(.*?) \}\}/g, (_, group1) => {
315810
- if (!secrets[group1]) {
315811
- throw new Error(`Secret ${group1} not found in secrets`);
315812
- }
315813
- return secrets[group1];
315814
- });
315815
- }
315816
- }
315817
- return config;
315818
- }
315819
316220
  function processOperationPlan_adaptProviders(item, deps) {
315820
316221
  const result = {};
315821
316222
  result['secrets'] = [];
@@ -315839,11 +316240,12 @@ function processOperationPlan_adaptProvider(providerFromItem, deps) {
315839
316240
  const providerName = `FirestartrProviderConfig-${providerFromItem.ref.name}`;
315840
316241
  const providerDependency = deps[providerName].cr;
315841
316242
  const providerSecrets = processOperationPlan_getRefContextFromCr(providerDependency, deps);
315842
- const providerConfigData = processOperationPlan_replaceConfigSecrets(JSON.parse(providerDependency.spec.config), providerSecrets);
316243
+ const providerConfigData = replaceConfigSecrets(JSON.parse(providerDependency.spec.config), providerSecrets);
316244
+ const providerInlineData = replaceInlineSecrets(providerDependency.spec.inline, providerSecrets);
315843
316245
  provider['name'] = providerDependency.spec.type;
315844
316246
  provider['version'] = providerDependency.spec.version;
315845
316247
  provider['source'] = providerDependency.spec.source;
315846
- provider['inline'] = providerDependency.spec.inline;
316248
+ provider['inline'] = providerInlineData;
315847
316249
  provider['config'] = providerConfigData;
315848
316250
  const secrets = [];
315849
316251
  if (providerDependency.spec.env) {
@@ -315867,9 +316269,11 @@ function processOperationPlan_adaptBackend(item, deps) {
315867
316269
  const backendName = `FirestartrProviderConfig-${item.spec.context.backend.ref.name}`;
315868
316270
  const backendDependency = deps[backendName].cr;
315869
316271
  const backendSecrets = processOperationPlan_getRefContextFromCr(backendDependency, deps);
315870
- const providerConfigData = processOperationPlan_replaceConfigSecrets(JSON.parse(backendDependency.spec.config), backendSecrets);
316272
+ const providerConfigData = replaceConfigSecrets(JSON.parse(backendDependency.spec.config), backendSecrets);
316273
+ const providerInlineData = replaceInlineSecrets(backendDependency.spec.inline, backendSecrets);
315871
316274
  backend[backendDependency.spec.type] = {};
315872
316275
  backend[backendDependency.spec.type]['config'] = providerConfigData;
316276
+ backend[backendDependency.spec.type]['inline'] = providerInlineData;
315873
316277
  return backend;
315874
316278
  }
315875
316279
  /**
@@ -896,6 +896,14 @@ export interface FirestartrGithubRepositorySpec {
896
896
  * @schema FirestartrGithubRepositorySpec#permissions
897
897
  */
898
898
  readonly permissions: FirestartrGithubRepositorySpecPermissions[];
899
+ /**
900
+ * @schema FirestartrGithubRepositorySpec#secrets
901
+ */
902
+ readonly secrets?: FirestartrGithubRepositorySpecSecrets;
903
+ /**
904
+ * @schema FirestartrGithubRepositorySpec#vars
905
+ */
906
+ readonly vars?: FirestartrGithubRepositorySpecVars;
899
907
  /**
900
908
  * @schema FirestartrGithubRepositorySpec#branchProtections
901
909
  */
@@ -1067,6 +1075,52 @@ export interface FirestartrGithubRepositorySpecPermissions {
1067
1075
  * Converts an object of type 'FirestartrGithubRepositorySpecPermissions' to JSON representation.
1068
1076
  */
1069
1077
  export declare function toJson_FirestartrGithubRepositorySpecPermissions(obj: FirestartrGithubRepositorySpecPermissions | undefined): Record<string, any> | undefined;
1078
+ /**
1079
+ * @schema FirestartrGithubRepositorySpecSecrets
1080
+ */
1081
+ export interface FirestartrGithubRepositorySpecSecrets {
1082
+ /**
1083
+ * @schema FirestartrGithubRepositorySpecSecrets#actions
1084
+ */
1085
+ readonly actions?: FirestartrGithubRepositorySpecSecretsActions[];
1086
+ /**
1087
+ * @schema FirestartrGithubRepositorySpecSecrets#codespaces
1088
+ */
1089
+ readonly codespaces?: FirestartrGithubRepositorySpecSecretsCodespaces[];
1090
+ /**
1091
+ * @schema FirestartrGithubRepositorySpecSecrets#copilot
1092
+ */
1093
+ readonly copilot?: FirestartrGithubRepositorySpecSecretsCopilot[];
1094
+ }
1095
+ /**
1096
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecrets' to JSON representation.
1097
+ */
1098
+ export declare function toJson_FirestartrGithubRepositorySpecSecrets(obj: FirestartrGithubRepositorySpecSecrets | undefined): Record<string, any> | undefined;
1099
+ /**
1100
+ * @schema FirestartrGithubRepositorySpecVars
1101
+ */
1102
+ export interface FirestartrGithubRepositorySpecVars {
1103
+ /**
1104
+ * @schema FirestartrGithubRepositorySpecVars#variableItemSchema
1105
+ */
1106
+ readonly variableItemSchema?: FirestartrGithubRepositorySpecVarsVariableItemSchema;
1107
+ /**
1108
+ * @schema FirestartrGithubRepositorySpecVars#actions
1109
+ */
1110
+ readonly actions?: FirestartrGithubRepositorySpecVarsActions[];
1111
+ /**
1112
+ * @schema FirestartrGithubRepositorySpecVars#dependabot
1113
+ */
1114
+ readonly dependabot?: FirestartrGithubRepositorySpecVarsDependabot[];
1115
+ /**
1116
+ * @schema FirestartrGithubRepositorySpecVars#codespaces
1117
+ */
1118
+ readonly codespaces?: FirestartrGithubRepositorySpecVarsCodespaces[];
1119
+ }
1120
+ /**
1121
+ * Converts an object of type 'FirestartrGithubRepositorySpecVars' to JSON representation.
1122
+ */
1123
+ export declare function toJson_FirestartrGithubRepositorySpecVars(obj: FirestartrGithubRepositorySpecVars | undefined): Record<string, any> | undefined;
1070
1124
  /**
1071
1125
  * @schema FirestartrGithubRepositorySpecBranchProtections
1072
1126
  */
@@ -1251,6 +1305,141 @@ export interface FirestartrGithubRepositorySpecPermissionsRef {
1251
1305
  * Converts an object of type 'FirestartrGithubRepositorySpecPermissionsRef' to JSON representation.
1252
1306
  */
1253
1307
  export declare function toJson_FirestartrGithubRepositorySpecPermissionsRef(obj: FirestartrGithubRepositorySpecPermissionsRef | undefined): Record<string, any> | undefined;
1308
+ /**
1309
+ * @schema FirestartrGithubRepositorySpecSecretsActions
1310
+ */
1311
+ export interface FirestartrGithubRepositorySpecSecretsActions {
1312
+ /**
1313
+ * @schema FirestartrGithubRepositorySpecSecretsActions#name
1314
+ */
1315
+ readonly name: string;
1316
+ /**
1317
+ * @schema FirestartrGithubRepositorySpecSecretsActions#ref
1318
+ */
1319
+ readonly ref: FirestartrGithubRepositorySpecSecretsActionsRef;
1320
+ }
1321
+ /**
1322
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsActions' to JSON representation.
1323
+ */
1324
+ export declare function toJson_FirestartrGithubRepositorySpecSecretsActions(obj: FirestartrGithubRepositorySpecSecretsActions | undefined): Record<string, any> | undefined;
1325
+ /**
1326
+ * @schema FirestartrGithubRepositorySpecSecretsCodespaces
1327
+ */
1328
+ export interface FirestartrGithubRepositorySpecSecretsCodespaces {
1329
+ /**
1330
+ * @schema FirestartrGithubRepositorySpecSecretsCodespaces#name
1331
+ */
1332
+ readonly name: string;
1333
+ /**
1334
+ * @schema FirestartrGithubRepositorySpecSecretsCodespaces#ref
1335
+ */
1336
+ readonly ref: FirestartrGithubRepositorySpecSecretsCodespacesRef;
1337
+ }
1338
+ /**
1339
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsCodespaces' to JSON representation.
1340
+ */
1341
+ export declare function toJson_FirestartrGithubRepositorySpecSecretsCodespaces(obj: FirestartrGithubRepositorySpecSecretsCodespaces | undefined): Record<string, any> | undefined;
1342
+ /**
1343
+ * @schema FirestartrGithubRepositorySpecSecretsCopilot
1344
+ */
1345
+ export interface FirestartrGithubRepositorySpecSecretsCopilot {
1346
+ /**
1347
+ * @schema FirestartrGithubRepositorySpecSecretsCopilot#name
1348
+ */
1349
+ readonly name: string;
1350
+ /**
1351
+ * @schema FirestartrGithubRepositorySpecSecretsCopilot#ref
1352
+ */
1353
+ readonly ref: FirestartrGithubRepositorySpecSecretsCopilotRef;
1354
+ }
1355
+ /**
1356
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsCopilot' to JSON representation.
1357
+ */
1358
+ export declare function toJson_FirestartrGithubRepositorySpecSecretsCopilot(obj: FirestartrGithubRepositorySpecSecretsCopilot | undefined): Record<string, any> | undefined;
1359
+ /**
1360
+ * @schema FirestartrGithubRepositorySpecVarsVariableItemSchema
1361
+ */
1362
+ export interface FirestartrGithubRepositorySpecVarsVariableItemSchema {
1363
+ /**
1364
+ * @schema FirestartrGithubRepositorySpecVarsVariableItemSchema#name
1365
+ */
1366
+ readonly name?: string;
1367
+ /**
1368
+ * @schema FirestartrGithubRepositorySpecVarsVariableItemSchema#value
1369
+ */
1370
+ readonly value?: string;
1371
+ /**
1372
+ * @schema FirestartrGithubRepositorySpecVarsVariableItemSchema#ref
1373
+ */
1374
+ readonly ref?: FirestartrGithubRepositorySpecVarsVariableItemSchemaRef;
1375
+ }
1376
+ /**
1377
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsVariableItemSchema' to JSON representation.
1378
+ */
1379
+ export declare function toJson_FirestartrGithubRepositorySpecVarsVariableItemSchema(obj: FirestartrGithubRepositorySpecVarsVariableItemSchema | undefined): Record<string, any> | undefined;
1380
+ /**
1381
+ * @schema FirestartrGithubRepositorySpecVarsActions
1382
+ */
1383
+ export interface FirestartrGithubRepositorySpecVarsActions {
1384
+ /**
1385
+ * @schema FirestartrGithubRepositorySpecVarsActions#name
1386
+ */
1387
+ readonly name?: string;
1388
+ /**
1389
+ * @schema FirestartrGithubRepositorySpecVarsActions#value
1390
+ */
1391
+ readonly value?: string;
1392
+ /**
1393
+ * @schema FirestartrGithubRepositorySpecVarsActions#ref
1394
+ */
1395
+ readonly ref?: FirestartrGithubRepositorySpecVarsActionsRef;
1396
+ }
1397
+ /**
1398
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsActions' to JSON representation.
1399
+ */
1400
+ export declare function toJson_FirestartrGithubRepositorySpecVarsActions(obj: FirestartrGithubRepositorySpecVarsActions | undefined): Record<string, any> | undefined;
1401
+ /**
1402
+ * @schema FirestartrGithubRepositorySpecVarsDependabot
1403
+ */
1404
+ export interface FirestartrGithubRepositorySpecVarsDependabot {
1405
+ /**
1406
+ * @schema FirestartrGithubRepositorySpecVarsDependabot#name
1407
+ */
1408
+ readonly name?: string;
1409
+ /**
1410
+ * @schema FirestartrGithubRepositorySpecVarsDependabot#value
1411
+ */
1412
+ readonly value?: string;
1413
+ /**
1414
+ * @schema FirestartrGithubRepositorySpecVarsDependabot#ref
1415
+ */
1416
+ readonly ref?: FirestartrGithubRepositorySpecVarsDependabotRef;
1417
+ }
1418
+ /**
1419
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsDependabot' to JSON representation.
1420
+ */
1421
+ export declare function toJson_FirestartrGithubRepositorySpecVarsDependabot(obj: FirestartrGithubRepositorySpecVarsDependabot | undefined): Record<string, any> | undefined;
1422
+ /**
1423
+ * @schema FirestartrGithubRepositorySpecVarsCodespaces
1424
+ */
1425
+ export interface FirestartrGithubRepositorySpecVarsCodespaces {
1426
+ /**
1427
+ * @schema FirestartrGithubRepositorySpecVarsCodespaces#name
1428
+ */
1429
+ readonly name?: string;
1430
+ /**
1431
+ * @schema FirestartrGithubRepositorySpecVarsCodespaces#value
1432
+ */
1433
+ readonly value?: string;
1434
+ /**
1435
+ * @schema FirestartrGithubRepositorySpecVarsCodespaces#ref
1436
+ */
1437
+ readonly ref?: FirestartrGithubRepositorySpecVarsCodespacesRef;
1438
+ }
1439
+ /**
1440
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsCodespaces' to JSON representation.
1441
+ */
1442
+ export declare function toJson_FirestartrGithubRepositorySpecVarsCodespaces(obj: FirestartrGithubRepositorySpecVarsCodespaces | undefined): Record<string, any> | undefined;
1254
1443
  /**
1255
1444
  * @schema FirestartrGithubRepositorySpecWriteConnectionSecretToRefOutputs
1256
1445
  */
@@ -1298,6 +1487,153 @@ export interface FirestartrGithubRepositorySpecContextProviderRef {
1298
1487
  * Converts an object of type 'FirestartrGithubRepositorySpecContextProviderRef' to JSON representation.
1299
1488
  */
1300
1489
  export declare function toJson_FirestartrGithubRepositorySpecContextProviderRef(obj: FirestartrGithubRepositorySpecContextProviderRef | undefined): Record<string, any> | undefined;
1490
+ /**
1491
+ * @schema FirestartrGithubRepositorySpecSecretsActionsRef
1492
+ */
1493
+ export interface FirestartrGithubRepositorySpecSecretsActionsRef {
1494
+ /**
1495
+ * @schema FirestartrGithubRepositorySpecSecretsActionsRef#kind
1496
+ */
1497
+ readonly kind: string;
1498
+ /**
1499
+ * @schema FirestartrGithubRepositorySpecSecretsActionsRef#name
1500
+ */
1501
+ readonly name: string;
1502
+ /**
1503
+ * @schema FirestartrGithubRepositorySpecSecretsActionsRef#key
1504
+ */
1505
+ readonly key: string;
1506
+ }
1507
+ /**
1508
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsActionsRef' to JSON representation.
1509
+ */
1510
+ export declare function toJson_FirestartrGithubRepositorySpecSecretsActionsRef(obj: FirestartrGithubRepositorySpecSecretsActionsRef | undefined): Record<string, any> | undefined;
1511
+ /**
1512
+ * @schema FirestartrGithubRepositorySpecSecretsCodespacesRef
1513
+ */
1514
+ export interface FirestartrGithubRepositorySpecSecretsCodespacesRef {
1515
+ /**
1516
+ * @schema FirestartrGithubRepositorySpecSecretsCodespacesRef#kind
1517
+ */
1518
+ readonly kind: string;
1519
+ /**
1520
+ * @schema FirestartrGithubRepositorySpecSecretsCodespacesRef#name
1521
+ */
1522
+ readonly name: string;
1523
+ /**
1524
+ * @schema FirestartrGithubRepositorySpecSecretsCodespacesRef#key
1525
+ */
1526
+ readonly key: string;
1527
+ }
1528
+ /**
1529
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsCodespacesRef' to JSON representation.
1530
+ */
1531
+ export declare function toJson_FirestartrGithubRepositorySpecSecretsCodespacesRef(obj: FirestartrGithubRepositorySpecSecretsCodespacesRef | undefined): Record<string, any> | undefined;
1532
+ /**
1533
+ * @schema FirestartrGithubRepositorySpecSecretsCopilotRef
1534
+ */
1535
+ export interface FirestartrGithubRepositorySpecSecretsCopilotRef {
1536
+ /**
1537
+ * @schema FirestartrGithubRepositorySpecSecretsCopilotRef#kind
1538
+ */
1539
+ readonly kind: string;
1540
+ /**
1541
+ * @schema FirestartrGithubRepositorySpecSecretsCopilotRef#name
1542
+ */
1543
+ readonly name: string;
1544
+ /**
1545
+ * @schema FirestartrGithubRepositorySpecSecretsCopilotRef#key
1546
+ */
1547
+ readonly key: string;
1548
+ }
1549
+ /**
1550
+ * Converts an object of type 'FirestartrGithubRepositorySpecSecretsCopilotRef' to JSON representation.
1551
+ */
1552
+ export declare function toJson_FirestartrGithubRepositorySpecSecretsCopilotRef(obj: FirestartrGithubRepositorySpecSecretsCopilotRef | undefined): Record<string, any> | undefined;
1553
+ /**
1554
+ * @schema FirestartrGithubRepositorySpecVarsVariableItemSchemaRef
1555
+ */
1556
+ export interface FirestartrGithubRepositorySpecVarsVariableItemSchemaRef {
1557
+ /**
1558
+ * @schema FirestartrGithubRepositorySpecVarsVariableItemSchemaRef#kind
1559
+ */
1560
+ readonly kind: string;
1561
+ /**
1562
+ * @schema FirestartrGithubRepositorySpecVarsVariableItemSchemaRef#name
1563
+ */
1564
+ readonly name: string;
1565
+ /**
1566
+ * @schema FirestartrGithubRepositorySpecVarsVariableItemSchemaRef#key
1567
+ */
1568
+ readonly key: string;
1569
+ }
1570
+ /**
1571
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsVariableItemSchemaRef' to JSON representation.
1572
+ */
1573
+ export declare function toJson_FirestartrGithubRepositorySpecVarsVariableItemSchemaRef(obj: FirestartrGithubRepositorySpecVarsVariableItemSchemaRef | undefined): Record<string, any> | undefined;
1574
+ /**
1575
+ * @schema FirestartrGithubRepositorySpecVarsActionsRef
1576
+ */
1577
+ export interface FirestartrGithubRepositorySpecVarsActionsRef {
1578
+ /**
1579
+ * @schema FirestartrGithubRepositorySpecVarsActionsRef#kind
1580
+ */
1581
+ readonly kind: string;
1582
+ /**
1583
+ * @schema FirestartrGithubRepositorySpecVarsActionsRef#name
1584
+ */
1585
+ readonly name: string;
1586
+ /**
1587
+ * @schema FirestartrGithubRepositorySpecVarsActionsRef#key
1588
+ */
1589
+ readonly key: string;
1590
+ }
1591
+ /**
1592
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsActionsRef' to JSON representation.
1593
+ */
1594
+ export declare function toJson_FirestartrGithubRepositorySpecVarsActionsRef(obj: FirestartrGithubRepositorySpecVarsActionsRef | undefined): Record<string, any> | undefined;
1595
+ /**
1596
+ * @schema FirestartrGithubRepositorySpecVarsDependabotRef
1597
+ */
1598
+ export interface FirestartrGithubRepositorySpecVarsDependabotRef {
1599
+ /**
1600
+ * @schema FirestartrGithubRepositorySpecVarsDependabotRef#kind
1601
+ */
1602
+ readonly kind: string;
1603
+ /**
1604
+ * @schema FirestartrGithubRepositorySpecVarsDependabotRef#name
1605
+ */
1606
+ readonly name: string;
1607
+ /**
1608
+ * @schema FirestartrGithubRepositorySpecVarsDependabotRef#key
1609
+ */
1610
+ readonly key: string;
1611
+ }
1612
+ /**
1613
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsDependabotRef' to JSON representation.
1614
+ */
1615
+ export declare function toJson_FirestartrGithubRepositorySpecVarsDependabotRef(obj: FirestartrGithubRepositorySpecVarsDependabotRef | undefined): Record<string, any> | undefined;
1616
+ /**
1617
+ * @schema FirestartrGithubRepositorySpecVarsCodespacesRef
1618
+ */
1619
+ export interface FirestartrGithubRepositorySpecVarsCodespacesRef {
1620
+ /**
1621
+ * @schema FirestartrGithubRepositorySpecVarsCodespacesRef#kind
1622
+ */
1623
+ readonly kind: string;
1624
+ /**
1625
+ * @schema FirestartrGithubRepositorySpecVarsCodespacesRef#name
1626
+ */
1627
+ readonly name: string;
1628
+ /**
1629
+ * @schema FirestartrGithubRepositorySpecVarsCodespacesRef#key
1630
+ */
1631
+ readonly key: string;
1632
+ }
1633
+ /**
1634
+ * Converts an object of type 'FirestartrGithubRepositorySpecVarsCodespacesRef' to JSON representation.
1635
+ */
1636
+ export declare function toJson_FirestartrGithubRepositorySpecVarsCodespacesRef(obj: FirestartrGithubRepositorySpecVarsCodespacesRef | undefined): Record<string, any> | undefined;
1301
1637
  /**
1302
1638
  * @schema FirestartrGithubRepositorySpecContextBackendRefKind
1303
1639
  */
@@ -1,4 +1,5 @@
1
1
  import { ApiObject, GroupVersionKind } from 'cdk8s';
2
+ import { NamedVars, RepoSecrets } from '../../utils/repositoryClaimUtils';
2
3
  import { FirestartrGithubRepositoryProps } from '../../../imports/firestartr.dev';
3
4
  import { IUnitializedStateKey } from '../../claims/base';
4
5
  import { BaseGithubChart } from './base';
@@ -14,6 +15,20 @@ export declare class GithubRepositoryChart extends BaseGithubChart {
14
15
  * @returns Permission[]
15
16
  */
16
17
  private createPermissions;
18
+ /**
19
+ * @description This method creates the vars data for the repository
20
+ * @param claim
21
+ * @returns VarsConfiguration
22
+ */
23
+ private createVars;
24
+ /**
25
+ * @description This method creates the secrets data for the repository
26
+ * @param claim
27
+ * @returns RepoSecretsConfiguration
28
+ */
29
+ private createRepoSecrets;
30
+ formatVars(blockDefinition: any): NamedVars;
31
+ formatRepoSecrets(blockDefinition: any): RepoSecrets;
17
32
  extraCharts(): {
18
33
  claim: {
19
34
  kind: string;
@@ -3,3 +3,4 @@ export declare function extractRefs(renderClaims: RenderClaims, kind: string): a
3
3
  export declare function extractAllRefs(claimData: string): any[];
4
4
  export declare function getGroupParentRef(parent: string, references?: any[]): any[];
5
5
  export declare function getTfWorkspacesRefs(values: any, references?: any[]): any[];
6
+ export declare function getComponentVarsAndSecretsRefs(parsedClaim: any): string[];
@@ -45,3 +45,45 @@ export interface CollaboratorPermission {
45
45
  * @returns string
46
46
  */
47
47
  export declare function createCodeOwnersData(claim: any, additionalRules?: any[]): string;
48
+ /**
49
+ * A reference to a secret, which can be an internal or external source.
50
+ */
51
+ export interface SecretRef {
52
+ kind: 'Secret' | 'ExternalSecret';
53
+ name: string;
54
+ key: string;
55
+ }
56
+ /**
57
+ * * A variable definition. It must have a name and can be either a literal
58
+ * * value or a reference to a secret.
59
+ * */
60
+ export type Var = {
61
+ name: string;
62
+ value: string;
63
+ } | {
64
+ name: string;
65
+ ref: SecretRef;
66
+ };
67
+ export type RepoSecret = {
68
+ name: string;
69
+ ref: RepoSecretRef;
70
+ };
71
+ export type NamedVars = Var[];
72
+ export type RepoSecrets = RepoSecret[];
73
+ export interface VarsConfiguration {
74
+ copilot?: NamedVars;
75
+ actions?: NamedVars;
76
+ codespaces?: NamedVars;
77
+ }
78
+ export interface RepoSecretsConfiguration {
79
+ copilot?: RepoSecrets;
80
+ actions?: RepoSecrets;
81
+ codespaces?: RepoSecrets;
82
+ }
83
+ export interface RepoSecretRef {
84
+ kind: 'secretsclaim';
85
+ name: string;
86
+ key: string;
87
+ }
88
+ export declare function isRepoSecretRef(suspectedRef: string): boolean;
89
+ export declare function extractRepoSecretRef(ref: string): RepoSecretRef;
@@ -0,0 +1,2 @@
1
+ export declare function replaceConfigSecrets(config: any, secrets: any): any;
2
+ export declare function replaceInlineSecrets(inline: string, secrets: any): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.49.0-snapshot-7",
3
+ "version": "1.49.0-snapshot-9",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",