@firestartr/cli 1.49.0-snapshot-1 → 1.49.0-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
@@ -301373,6 +301373,12 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
301373
301373
  $ref: 'firestartr.dev://github/GithubComponentFeatureClaim',
301374
301374
  },
301375
301375
  },
301376
+ vars: {
301377
+ $ref: 'firestartr.dev://github/GithubComponentClaimVars',
301378
+ },
301379
+ secrets: {
301380
+ $ref: 'firestartr.dev://github/GithubComponentClaimSecrets',
301381
+ },
301376
301382
  },
301377
301383
  required: ['visibility', 'org'],
301378
301384
  },
@@ -301479,18 +301485,118 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
301479
301485
  },
301480
301486
  });
301481
301487
 
301488
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/component.secrets-vars.schema.ts
301489
+
301490
+ /* harmony default export */ const component_secrets_vars_schema = ({
301491
+ $schema: SCHEMA,
301492
+ $id: 'GithubComponentClaimVarsAndSecrets',
301493
+ definitions: {
301494
+ GithubComponentClaimVars: {
301495
+ $id: 'firestartr.dev://github/GithubComponentClaimVars',
301496
+ type: 'object',
301497
+ properties: {
301498
+ actions: {
301499
+ type: 'array',
301500
+ items: {
301501
+ $ref: 'firestartr.dev://github/GithubComponentClaimRepoVar',
301502
+ },
301503
+ },
301504
+ codespaces: {
301505
+ type: 'array',
301506
+ items: {
301507
+ $ref: 'firestartr.dev://github/GithubComponentClaimRepoVar',
301508
+ },
301509
+ },
301510
+ dependabot: {
301511
+ type: 'array',
301512
+ items: {
301513
+ $ref: 'firestartr.dev://github/GithubComponentClaimRepoVar',
301514
+ },
301515
+ },
301516
+ },
301517
+ additionalProperties: false,
301518
+ },
301519
+ GithubComponentClaimSecrets: {
301520
+ $id: 'firestartr.dev://github/GithubComponentClaimSecrets',
301521
+ type: 'object',
301522
+ properties: {
301523
+ actions: {
301524
+ type: 'array',
301525
+ items: {
301526
+ $ref: 'firestartr.dev://github/GithubComponentClaimRepoSecret',
301527
+ },
301528
+ },
301529
+ codespaces: {
301530
+ type: 'array',
301531
+ items: {
301532
+ $ref: 'firestartr.dev://github/GithubComponentClaimRepoSecret',
301533
+ },
301534
+ },
301535
+ dependabot: {
301536
+ type: 'array',
301537
+ items: {
301538
+ $ref: 'firestartr.dev://github/GithubComponentClaimRepoSecret',
301539
+ },
301540
+ },
301541
+ },
301542
+ additionalProperties: false,
301543
+ },
301544
+ GithubComponentClaimSecretRef: {
301545
+ $id: 'firestartr.dev://github/GithubComponentClaimSecretRef',
301546
+ type: 'string',
301547
+ description: 'the reference of the secret',
301548
+ pattern: '^ref:secretclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$',
301549
+ },
301550
+ GithubComponentClaimRepoSecret: {
301551
+ $id: 'firestartr.dev://github/GithubComponentClaimRepoSecret',
301552
+ type: 'object',
301553
+ description: 'A secret for a github repo',
301554
+ properties: {
301555
+ name: {
301556
+ type: 'string',
301557
+ description: 'the name of the secret',
301558
+ },
301559
+ value: {
301560
+ $ref: 'firestartr.dev://github/GithubComponentClaimSecretRef',
301561
+ },
301562
+ },
301563
+ required: ['name', 'value'],
301564
+ additionalProperties: false,
301565
+ },
301566
+ GithubComponentClaimRepoVar: {
301567
+ $id: 'firestartr.dev://github/GithubComponentClaimRepoVar',
301568
+ type: 'object',
301569
+ description: 'A var for a github repo',
301570
+ properties: {
301571
+ name: {
301572
+ type: 'string',
301573
+ description: 'the name of the var',
301574
+ },
301575
+ value: {
301576
+ type: 'string',
301577
+ description: 'the value of the var',
301578
+ },
301579
+ },
301580
+ required: ['name', 'value'],
301581
+ additionalProperties: false,
301582
+ },
301583
+ },
301584
+ });
301585
+
301482
301586
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/index.ts
301483
301587
 
301484
301588
 
301485
301589
 
301486
301590
 
301487
301591
 
301592
+
301488
301593
  const GithubSchemas = [
301489
301594
  github_group_schema,
301490
301595
  github_user_schema,
301491
301596
  feature_schema,
301492
301597
  github_component_schema,
301493
301598
  github_orgwebhook_schema,
301599
+ component_secrets_vars_schema,
301494
301600
  ];
301495
301601
 
301496
301602
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/tfworkspaces/terraform.schema.ts
@@ -302486,30 +302592,6 @@ function validateCrSizes(crs) {
302486
302592
  }
302487
302593
  }
302488
302594
 
302489
- ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/permissions.ts
302490
-
302491
- function validatePermissionsUniqueness(crs) {
302492
- for (const crkey in crs) {
302493
- const cr = crs[crkey];
302494
- if (cr.kind === 'FirestartrGithubRepository') {
302495
- const permissions = cr.spec.permissions;
302496
- cdk8s_renderer_src_logger.debug(`Validating Permissions Uniqueness of ${crkey}`);
302497
- if (permissions) {
302498
- const seen = new Set();
302499
- for (const perm of permissions) {
302500
- const identifier = perm.collaborator
302501
- ? perm.collaborator
302502
- : `ref:${perm.ref.kind}:${perm.ref.name}`;
302503
- if (seen.has(identifier)) {
302504
- throw new Error(`Duplicate permission reference found in FirestartrGithubRepository ${crkey}: ${identifier}\nFull CR: ${JSON.stringify(cr, null, 2)}`);
302505
- }
302506
- seen.add(identifier);
302507
- }
302508
- }
302509
- }
302510
- }
302511
- }
302512
-
302513
302595
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/refsSorter/refsSorter.ts
302514
302596
 
302515
302597
  /**
@@ -307864,7 +307946,6 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
307864
307946
 
307865
307947
 
307866
307948
 
307867
-
307868
307949
  /*
307869
307950
  * Function called when rendering but not importing
307870
307951
  *
@@ -307881,7 +307962,6 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
307881
307962
  const result = await renderClaims(catalogScope, firestartrScope, data);
307882
307963
  validateTfStateKeyUniqueness(result);
307883
307964
  validateCrSizes(result);
307884
- validatePermissionsUniqueness(result);
307885
307965
  return result;
307886
307966
  }
307887
307967
 
@@ -313671,6 +313751,16 @@ async function output(path, secrets) {
313671
313751
  return await tfExec(path, ['output', '-json'], secrets, []);
313672
313752
  }
313673
313753
  async function tfExec(path, args, secrets, extraArgs = ['-input=false'], stream) {
313754
+ // Format to TF_VAR variables -> https://developer.hashicorp.com/terraform/cli/config/environment-variables#tf_var_name
313755
+ // for (const secret of secrets) {
313756
+ // process.env[`${secret.key}`] = secret.value;
313757
+ // }
313758
+ //
313759
+ // log.info(
313760
+ // `Spawning terraform process ['terraform ${args.concat(extraArgs).join(' ')}'] in path '${path}'`,
313761
+ // );
313762
+ //
313763
+ // process.env['TF_PLUGIN_CACHE_DIR'] = '/home/terraform-plugins-cache';
313674
313764
  return new Promise((ok, ko) => {
313675
313765
  const tfProcess = (0,external_child_process_.spawn)('terraform', args.concat(extraArgs), {
313676
313766
  cwd: path,
@@ -497,6 +497,12 @@ declare const schemas: {
497
497
  $ref: string;
498
498
  };
499
499
  };
500
+ vars: {
501
+ $ref: string;
502
+ };
503
+ secrets: {
504
+ $ref: string;
505
+ };
500
506
  };
501
507
  required: string[];
502
508
  $ref?: undefined;
@@ -555,6 +561,100 @@ declare const schemas: {
555
561
  })[];
556
562
  };
557
563
  };
564
+ } | {
565
+ $schema: string;
566
+ $id: string;
567
+ definitions: {
568
+ GithubComponentClaimVars: {
569
+ $id: string;
570
+ type: string;
571
+ properties: {
572
+ actions: {
573
+ type: string;
574
+ items: {
575
+ $ref: string;
576
+ };
577
+ };
578
+ codespaces: {
579
+ type: string;
580
+ items: {
581
+ $ref: string;
582
+ };
583
+ };
584
+ dependabot: {
585
+ type: string;
586
+ items: {
587
+ $ref: string;
588
+ };
589
+ };
590
+ };
591
+ additionalProperties: boolean;
592
+ };
593
+ GithubComponentClaimSecrets: {
594
+ $id: string;
595
+ type: string;
596
+ properties: {
597
+ actions: {
598
+ type: string;
599
+ items: {
600
+ $ref: string;
601
+ };
602
+ };
603
+ codespaces: {
604
+ type: string;
605
+ items: {
606
+ $ref: string;
607
+ };
608
+ };
609
+ dependabot: {
610
+ type: string;
611
+ items: {
612
+ $ref: string;
613
+ };
614
+ };
615
+ };
616
+ additionalProperties: boolean;
617
+ };
618
+ GithubComponentClaimSecretRef: {
619
+ $id: string;
620
+ type: string;
621
+ description: string;
622
+ pattern: string;
623
+ };
624
+ GithubComponentClaimRepoSecret: {
625
+ $id: string;
626
+ type: string;
627
+ description: string;
628
+ properties: {
629
+ name: {
630
+ type: string;
631
+ description: string;
632
+ };
633
+ value: {
634
+ $ref: string;
635
+ };
636
+ };
637
+ required: string[];
638
+ additionalProperties: boolean;
639
+ };
640
+ GithubComponentClaimRepoVar: {
641
+ $id: string;
642
+ type: string;
643
+ description: string;
644
+ properties: {
645
+ name: {
646
+ type: string;
647
+ description: string;
648
+ };
649
+ value: {
650
+ type: string;
651
+ description: string;
652
+ };
653
+ };
654
+ required: string[];
655
+ additionalProperties: boolean;
656
+ };
657
+ };
558
658
  })[] | {
559
659
  $id: string;
560
660
  definitions: {
@@ -29,6 +29,12 @@ declare const _default: {
29
29
  $ref: string;
30
30
  };
31
31
  };
32
+ vars: {
33
+ $ref: string;
34
+ };
35
+ secrets: {
36
+ $ref: string;
37
+ };
32
38
  };
33
39
  required: string[];
34
40
  $ref?: undefined;
@@ -0,0 +1,96 @@
1
+ declare const _default: {
2
+ $schema: string;
3
+ $id: string;
4
+ definitions: {
5
+ GithubComponentClaimVars: {
6
+ $id: string;
7
+ type: string;
8
+ properties: {
9
+ actions: {
10
+ type: string;
11
+ items: {
12
+ $ref: string;
13
+ };
14
+ };
15
+ codespaces: {
16
+ type: string;
17
+ items: {
18
+ $ref: string;
19
+ };
20
+ };
21
+ dependabot: {
22
+ type: string;
23
+ items: {
24
+ $ref: string;
25
+ };
26
+ };
27
+ };
28
+ additionalProperties: boolean;
29
+ };
30
+ GithubComponentClaimSecrets: {
31
+ $id: string;
32
+ type: string;
33
+ properties: {
34
+ actions: {
35
+ type: string;
36
+ items: {
37
+ $ref: string;
38
+ };
39
+ };
40
+ codespaces: {
41
+ type: string;
42
+ items: {
43
+ $ref: string;
44
+ };
45
+ };
46
+ dependabot: {
47
+ type: string;
48
+ items: {
49
+ $ref: string;
50
+ };
51
+ };
52
+ };
53
+ additionalProperties: boolean;
54
+ };
55
+ GithubComponentClaimSecretRef: {
56
+ $id: string;
57
+ type: string;
58
+ description: string;
59
+ pattern: string;
60
+ };
61
+ GithubComponentClaimRepoSecret: {
62
+ $id: string;
63
+ type: string;
64
+ description: string;
65
+ properties: {
66
+ name: {
67
+ type: string;
68
+ description: string;
69
+ };
70
+ value: {
71
+ $ref: string;
72
+ };
73
+ };
74
+ required: string[];
75
+ additionalProperties: boolean;
76
+ };
77
+ GithubComponentClaimRepoVar: {
78
+ $id: string;
79
+ type: string;
80
+ description: string;
81
+ properties: {
82
+ name: {
83
+ type: string;
84
+ description: string;
85
+ };
86
+ value: {
87
+ type: string;
88
+ description: string;
89
+ };
90
+ };
91
+ required: string[];
92
+ additionalProperties: boolean;
93
+ };
94
+ };
95
+ };
96
+ export default _default;
@@ -134,6 +134,12 @@ export declare const GithubSchemas: ({
134
134
  $ref: string;
135
135
  };
136
136
  };
137
+ vars: {
138
+ $ref: string;
139
+ };
140
+ secrets: {
141
+ $ref: string;
142
+ };
137
143
  };
138
144
  required: string[];
139
145
  $ref?: undefined;
@@ -192,4 +198,98 @@ export declare const GithubSchemas: ({
192
198
  })[];
193
199
  };
194
200
  };
201
+ } | {
202
+ $schema: string;
203
+ $id: string;
204
+ definitions: {
205
+ GithubComponentClaimVars: {
206
+ $id: string;
207
+ type: string;
208
+ properties: {
209
+ actions: {
210
+ type: string;
211
+ items: {
212
+ $ref: string;
213
+ };
214
+ };
215
+ codespaces: {
216
+ type: string;
217
+ items: {
218
+ $ref: string;
219
+ };
220
+ };
221
+ dependabot: {
222
+ type: string;
223
+ items: {
224
+ $ref: string;
225
+ };
226
+ };
227
+ };
228
+ additionalProperties: boolean;
229
+ };
230
+ GithubComponentClaimSecrets: {
231
+ $id: string;
232
+ type: string;
233
+ properties: {
234
+ actions: {
235
+ type: string;
236
+ items: {
237
+ $ref: string;
238
+ };
239
+ };
240
+ codespaces: {
241
+ type: string;
242
+ items: {
243
+ $ref: string;
244
+ };
245
+ };
246
+ dependabot: {
247
+ type: string;
248
+ items: {
249
+ $ref: string;
250
+ };
251
+ };
252
+ };
253
+ additionalProperties: boolean;
254
+ };
255
+ GithubComponentClaimSecretRef: {
256
+ $id: string;
257
+ type: string;
258
+ description: string;
259
+ pattern: string;
260
+ };
261
+ GithubComponentClaimRepoSecret: {
262
+ $id: string;
263
+ type: string;
264
+ description: string;
265
+ properties: {
266
+ name: {
267
+ type: string;
268
+ description: string;
269
+ };
270
+ value: {
271
+ $ref: string;
272
+ };
273
+ };
274
+ required: string[];
275
+ additionalProperties: boolean;
276
+ };
277
+ GithubComponentClaimRepoVar: {
278
+ $id: string;
279
+ type: string;
280
+ description: string;
281
+ properties: {
282
+ name: {
283
+ type: string;
284
+ description: string;
285
+ };
286
+ value: {
287
+ type: string;
288
+ description: string;
289
+ };
290
+ };
291
+ required: string[];
292
+ additionalProperties: boolean;
293
+ };
294
+ };
195
295
  })[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.49.0-snapshot-1",
3
+ "version": "1.49.0-snapshot-2",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",
@@ -1,2 +0,0 @@
1
- import { RenderedCrMap } from '../renderer/types';
2
- export declare function validatePermissionsUniqueness(crs: RenderedCrMap): void;