@firestartr/cli 1.50.0 → 1.50.1-snapshot

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.
Files changed (2) hide show
  1. package/build/index.js +149 -88
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -309585,10 +309585,19 @@ class GithubDecanter extends decanter_base {
309585
309585
  }
309586
309586
  }
309587
309587
 
309588
+ ;// CONCATENATED MODULE: ../importer/src/logger.ts
309589
+
309590
+ /* harmony default export */ const importer_src_logger = (catalog_common.logger);
309591
+
309588
309592
  ;// CONCATENATED MODULE: ../importer/src/decanter/gh/github_group.ts
309589
309593
 
309590
309594
 
309591
309595
 
309596
+
309597
+
309598
+
309599
+
309600
+
309592
309601
  class GroupGithubDecanter extends GithubDecanter {
309593
309602
  constructor() {
309594
309603
  super(...arguments);
@@ -309645,28 +309654,43 @@ class GroupGithubDecanter extends GithubDecanter {
309645
309654
  return this.__validateEqual(members, this.data.members);
309646
309655
  }
309647
309656
  async __adaptInitializerBase(_claim) {
309648
- const adapterBase = {
309649
- name: 'base',
309650
- apiVersion: 'firestartr.dev/v1',
309651
- kind: 'FirestartrGithubGroup',
309652
- defaultValues: {
309653
- context: {
309654
- backend: {
309655
- ref: {
309656
- kind: 'FirestartrProviderConfig',
309657
- name: 'firestartr-terraform-state',
309657
+ let githubGroupDefaultsFilePath;
309658
+ try {
309659
+ githubGroupDefaultsFilePath = external_path_.join(getConfigPath(), 'resources', 'defaults_github_group.yaml');
309660
+ }
309661
+ catch (e) {
309662
+ importer_src_logger.warn('No config path set, using built-in defaults');
309663
+ githubGroupDefaultsFilePath = '';
309664
+ }
309665
+ let adapter;
309666
+ if (githubGroupDefaultsFilePath &&
309667
+ external_fs_.existsSync(githubGroupDefaultsFilePath)) {
309668
+ adapter = catalog_common.io.fromYaml(external_fs_.readFileSync(githubGroupDefaultsFilePath, 'utf-8'));
309669
+ }
309670
+ else {
309671
+ adapter = {
309672
+ name: 'base',
309673
+ apiVersion: 'firestartr.dev/v1',
309674
+ kind: 'FirestartrGithubGroup',
309675
+ defaultValues: {
309676
+ context: {
309677
+ backend: {
309678
+ ref: {
309679
+ kind: 'FirestartrProviderConfig',
309680
+ name: 'firestartr-terraform-state',
309681
+ },
309658
309682
  },
309659
- },
309660
- provider: {
309661
- ref: {
309662
- kind: 'FirestartrProviderConfig',
309663
- name: 'github-app',
309683
+ provider: {
309684
+ ref: {
309685
+ kind: 'FirestartrProviderConfig',
309686
+ name: 'github-app',
309687
+ },
309664
309688
  },
309665
309689
  },
309666
309690
  },
309667
- },
309668
- };
309669
- return new InitializerDefault(adapterBase);
309691
+ };
309692
+ }
309693
+ return new InitializerDefault(adapter);
309670
309694
  }
309671
309695
  __validateKind(cr) {
309672
309696
  return true;
@@ -309763,6 +309787,11 @@ applyCollectionMixins(GroupCollectionGithubDecanter);
309763
309787
 
309764
309788
 
309765
309789
 
309790
+
309791
+
309792
+
309793
+
309794
+
309766
309795
  class MemberGithubDecanter extends GithubDecanter {
309767
309796
  constructor() {
309768
309797
  super(...arguments);
@@ -309800,28 +309829,43 @@ class MemberGithubDecanter extends GithubDecanter {
309800
309829
  });
309801
309830
  }
309802
309831
  async __adaptInitializerBase(_claim) {
309803
- const adapterBase = {
309804
- name: 'base',
309805
- apiVersion: 'firestartr.dev/v1',
309806
- kind: 'FirestartrGithubMembership',
309807
- defaultValues: {
309808
- context: {
309809
- backend: {
309810
- ref: {
309811
- kind: 'FirestartrProviderConfig',
309812
- name: 'firestartr-terraform-state',
309832
+ let githubMemberDefaultsFilePath;
309833
+ try {
309834
+ githubMemberDefaultsFilePath = external_path_.join(getConfigPath(), 'resources', 'defaults_github_membership.yaml');
309835
+ }
309836
+ catch (e) {
309837
+ importer_src_logger.warn('No config path set, using built-in defaults');
309838
+ githubMemberDefaultsFilePath = '';
309839
+ }
309840
+ let adapter;
309841
+ if (githubMemberDefaultsFilePath &&
309842
+ external_fs_.existsSync(githubMemberDefaultsFilePath)) {
309843
+ adapter = catalog_common.io.fromYaml(external_fs_.readFileSync(githubMemberDefaultsFilePath, 'utf-8'));
309844
+ }
309845
+ else {
309846
+ adapter = {
309847
+ name: 'base',
309848
+ apiVersion: 'firestartr.dev/v1',
309849
+ kind: 'FirestartrGithubMembership',
309850
+ defaultValues: {
309851
+ context: {
309852
+ backend: {
309853
+ ref: {
309854
+ kind: 'FirestartrProviderConfig',
309855
+ name: 'firestartr-terraform-state',
309856
+ },
309813
309857
  },
309814
- },
309815
- provider: {
309816
- ref: {
309817
- kind: 'FirestartrProviderConfig',
309818
- name: 'github-app',
309858
+ provider: {
309859
+ ref: {
309860
+ kind: 'FirestartrProviderConfig',
309861
+ name: 'github-app',
309862
+ },
309819
309863
  },
309820
309864
  },
309821
309865
  },
309822
- },
309823
- };
309824
- return new InitializerDefault(adapterBase);
309866
+ };
309867
+ }
309868
+ return new InitializerDefault(adapter);
309825
309869
  }
309826
309870
  }
309827
309871
 
@@ -309854,6 +309898,11 @@ applyCollectionMixins(MemberCollectionGithubDecanter);
309854
309898
 
309855
309899
 
309856
309900
 
309901
+
309902
+
309903
+
309904
+
309905
+
309857
309906
  const TYPE_MAP = {
309858
309907
  User: 'user',
309859
309908
  Team: 'group',
@@ -310108,59 +310157,75 @@ class RepoGithubDecanter extends GithubDecanter {
310108
310157
  return null;
310109
310158
  }
310110
310159
  async __adaptInitializerBase(_claim) {
310111
- const adapterBase = {
310112
- name: 'base',
310113
- apiVersion: 'firestartr.dev/v1',
310114
- kind: 'FirestartrGithubRepository',
310115
- defaultValues: {
310116
- context: {
310117
- backend: {
310118
- ref: {
310119
- kind: 'FirestartrProviderConfig',
310120
- name: 'firestartr-terraform-state',
310160
+ let githubRepoDefaultsFilePath;
310161
+ try {
310162
+ githubRepoDefaultsFilePath = external_path_.join(getConfigPath(), 'resources', 'defaults_github_membership.yaml');
310163
+ }
310164
+ catch (e) {
310165
+ importer_src_logger.warn('No config path set, using built-in defaults');
310166
+ console.log('No config path set, using built-in defaults');
310167
+ githubRepoDefaultsFilePath = '';
310168
+ }
310169
+ let adapter;
310170
+ if (githubRepoDefaultsFilePath &&
310171
+ external_fs_.existsSync(githubRepoDefaultsFilePath)) {
310172
+ adapter = catalog_common.io.fromYaml(external_fs_.readFileSync(githubRepoDefaultsFilePath, 'utf-8'));
310173
+ }
310174
+ else {
310175
+ adapter = {
310176
+ name: 'base',
310177
+ apiVersion: 'firestartr.dev/v1',
310178
+ kind: 'FirestartrGithubRepository',
310179
+ defaultValues: {
310180
+ context: {
310181
+ backend: {
310182
+ ref: {
310183
+ kind: 'FirestartrProviderConfig',
310184
+ name: 'firestartr-terraform-state',
310185
+ },
310121
310186
  },
310122
- },
310123
- provider: {
310124
- ref: {
310125
- kind: 'FirestartrProviderConfig',
310126
- name: 'github-app',
310187
+ provider: {
310188
+ ref: {
310189
+ kind: 'FirestartrProviderConfig',
310190
+ name: 'github-app',
310191
+ },
310127
310192
  },
310128
310193
  },
310129
- },
310130
- name: this.data.repoDetails.name,
310131
- description: this.data.repoDetails.description,
310132
- org: this.org,
310133
- firestartr: {
310134
- technology: { stack: 'none', version: 'none' },
310135
- },
310136
- repo: {
310194
+ name: this.data.repoDetails.name,
310137
310195
  description: this.data.repoDetails.description,
310138
- allowMergeCommit: this.data.repoDetails.allow_merge_commit,
310139
- allowSquashMerge: this.data.repoDetails.allow_squash_merge,
310140
- allowRebaseMerge: this.data.repoDetails.allow_rebase_merge,
310141
- allowAutoMerge: this.data.repoDetails.allow_auto_merge,
310142
- deleteBranchOnMerge: this.data.repoDetails.delete_branch_on_merge,
310143
- autoInit: true,
310144
- archiveOnDestroy: true,
310145
- allowUpdateBranch: this.data.repoDetails.allow_update_branch,
310146
- hasIssues: this.data.repoDetails.has_issues,
310147
- visibility: this.data.repoDetails.visibility,
310148
- defaultBranch: this.data.repoDetails.default_branch,
310149
- },
310150
- permissions: [],
310151
- actions: {
310152
- oidc: this.data.oidc.use_default
310153
- ? undefined
310154
- : {
310155
- useDefault: this.data.oidc.use_default,
310156
- includeClaimKeys: this.data.oidc.include_claim_keys
310157
- ? this.data.oidc.include_claim_keys
310158
- : [],
310159
- },
310196
+ org: this.org,
310197
+ firestartr: {
310198
+ technology: { stack: 'none', version: 'none' },
310199
+ },
310200
+ repo: {
310201
+ description: this.data.repoDetails.description,
310202
+ allowMergeCommit: this.data.repoDetails.allow_merge_commit,
310203
+ allowSquashMerge: this.data.repoDetails.allow_squash_merge,
310204
+ allowRebaseMerge: this.data.repoDetails.allow_rebase_merge,
310205
+ allowAutoMerge: this.data.repoDetails.allow_auto_merge,
310206
+ deleteBranchOnMerge: this.data.repoDetails.delete_branch_on_merge,
310207
+ autoInit: true,
310208
+ archiveOnDestroy: true,
310209
+ allowUpdateBranch: this.data.repoDetails.allow_update_branch,
310210
+ hasIssues: this.data.repoDetails.has_issues,
310211
+ visibility: this.data.repoDetails.visibility,
310212
+ defaultBranch: this.data.repoDetails.default_branch,
310213
+ },
310214
+ permissions: [],
310215
+ actions: {
310216
+ oidc: this.data.oidc.use_default
310217
+ ? undefined
310218
+ : {
310219
+ useDefault: this.data.oidc.use_default,
310220
+ includeClaimKeys: this.data.oidc.include_claim_keys
310221
+ ? this.data.oidc.include_claim_keys
310222
+ : [],
310223
+ },
310224
+ },
310160
310225
  },
310161
- },
310162
- };
310163
- return new InitializerDefault(adapterBase);
310226
+ };
310227
+ }
310228
+ return new InitializerDefault(adapter);
310164
310229
  }
310165
310230
  async __adaptOverriderRepo(_claim) {
310166
310231
  return new GithubRepositoryOverrider();
@@ -310196,10 +310261,6 @@ RepoCollectionGithubDecanter.collectionKind = 'gh-repo';
310196
310261
  applyCollectionMixins(RepoCollectionGithubDecanter);
310197
310262
  /* harmony default export */ const github_repo_collection = (RepoCollectionGithubDecanter);
310198
310263
 
310199
- ;// CONCATENATED MODULE: ../importer/src/logger.ts
310200
-
310201
- /* harmony default export */ const importer_src_logger = (catalog_common.logger);
310202
-
310203
310264
  ;// CONCATENATED MODULE: ../importer/src/decanter/index.ts
310204
310265
 
310205
310266
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.50.0",
3
+ "version": "1.50.1-snapshot",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",