@firestartr/cli 1.54.0-snapshot-7 → 1.54.0-snapshot-10

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
@@ -151708,7 +151708,7 @@ module.exports = exports.default;
151708
151708
 
151709
151709
  /***/ }),
151710
151710
 
151711
- /***/ 89323:
151711
+ /***/ 60762:
151712
151712
  /***/ ((module, exports) => {
151713
151713
 
151714
151714
 
@@ -151775,7 +151775,7 @@ var _isArrayLike = __nccwpck_require__(10860);
151775
151775
 
151776
151776
  var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
151777
151777
 
151778
- var _getIterator = __nccwpck_require__(89323);
151778
+ var _getIterator = __nccwpck_require__(60762);
151779
151779
 
151780
151780
  var _getIterator2 = _interopRequireDefault(_getIterator);
151781
151781
 
@@ -355602,7 +355602,7 @@ class GlobalDefault extends DefaultSection {
355602
355602
  // Thus it performs a nullify of the designed patches
355603
355603
 
355604
355604
 
355605
- const ONE_WAY_DEFINITIONS = ['/spec/vars'];
355605
+ const ONE_WAY_DEFINITIONS = ['/spec/vars', '/spec/actions/oidc'];
355606
355606
  function applyOneWayDefs(crSpecs) {
355607
355607
  const crSpecsClone = JSON.parse(JSON.stringify(crSpecs));
355608
355608
  for (const defPath of ONE_WAY_DEFINITIONS) {
@@ -357285,13 +357285,10 @@ class RevisionNormalizer extends Normalizer {
357285
357285
  }
357286
357286
  }
357287
357287
 
357288
- // EXTERNAL MODULE: external "fs/promises"
357289
- var external_fs_promises_ = __nccwpck_require__(73292);
357290
357288
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/normalizers/tfworkspace.ts
357291
357289
 
357292
357290
 
357293
357291
 
357294
-
357295
357292
  class TFWorkspaceNormalizer extends Normalizer {
357296
357293
  constructor() {
357297
357294
  super(...arguments);
@@ -357319,15 +357316,6 @@ class TFWorkspaceNormalizer extends Normalizer {
357319
357316
  const normalizedContent = await normalizeModuleContent(dirTfRootModule);
357320
357317
  cr.spec['module'] = normalizedContent;
357321
357318
  }
357322
- if ('files' in claim.providers.terraform) {
357323
- try {
357324
- const additionalFiles = await loadAdditionalFiles(claim.providers.terraform['files'], external_path_.dirname(claimPath));
357325
- cr.spec['files'] = additionalFiles;
357326
- }
357327
- catch (err) {
357328
- throw new Error(`Loading additional files for TFWorkspace: ${claim.name}: ${err && err.message ? err.message : err}`);
357329
- }
357330
- }
357331
357319
  return cr;
357332
357320
  },
357333
357321
  identify() {
@@ -357356,33 +357344,6 @@ ${files[entry]}
357356
357344
  });
357357
357345
  return content;
357358
357346
  }
357359
- async function loadAdditionalFiles(files, tfRootModulePath) {
357360
- const specFiles = [];
357361
- for (const additionalFile of files) {
357362
- const specFile = {
357363
- path: additionalFile.destination,
357364
- content: await loadAdditionalFile(additionalFile.source, tfRootModulePath),
357365
- };
357366
- specFiles.push(specFile);
357367
- }
357368
- return specFiles;
357369
- }
357370
- async function loadAdditionalFile(source, tfRootModulePath) {
357371
- try {
357372
- const filePath = external_path_.join(tfRootModulePath, source);
357373
- const stats = await external_fs_promises_.stat(filePath);
357374
- if (!stats.isFile()) {
357375
- throw new Error(`${source} is not a file`);
357376
- }
357377
- const content = await external_fs_promises_.readFile(filePath, {
357378
- encoding: 'utf8',
357379
- });
357380
- return Buffer.from(content, 'utf8').toString('base64');
357381
- }
357382
- catch (err) {
357383
- throw new Error(`Loading additional tfworkspace file ${source}: ${err && err.message ? err.message : err}`);
357384
- }
357385
- }
357386
357347
  function validatek8sLimits(moduleContent) {
357387
357348
  const moduleLength = moduleContent.length;
357388
357349
  return moduleLength > 0 && moduleLength < 750000;
@@ -358384,26 +358345,6 @@ const GithubSchemas = [
358384
358345
  /* harmony default export */ const terraform_schema = ({
358385
358346
  $id: 'TerraformProvider',
358386
358347
  definitions: {
358387
- TerraformProviderFiles: {
358388
- $id: 'firestartr.dev://terraform/TerraformProviderFiles',
358389
- description: 'A list of files included in the terraform project',
358390
- type: 'array',
358391
- items: {
358392
- type: 'object',
358393
- properties: {
358394
- source: {
358395
- type: 'string',
358396
- description: 'path of the original file to include in the final CR',
358397
- },
358398
- destination: {
358399
- type: 'string',
358400
- description: 'path where the file will be placed in the final terraform project',
358401
- },
358402
- },
358403
- additionalProperties: false,
358404
- required: ['source', 'destination'],
358405
- },
358406
- },
358407
358348
  TerraformProvider: {
358408
358349
  $id: 'firestartr.dev://terraform/TerraformProvider',
358409
358350
  type: 'object',
@@ -358433,9 +358374,6 @@ const GithubSchemas = [
358433
358374
  type: 'string',
358434
358375
  enum: ['remote', 'inline', 'Remote', 'Inline'],
358435
358376
  },
358436
- files: {
358437
- $ref: 'firestartr.dev://terraform/TerraformProviderFiles',
358438
- },
358439
358377
  sync: {
358440
358378
  type: 'object',
358441
358379
  properties: {
@@ -363451,7 +363389,6 @@ function toJson_FirestartrTerraformWorkspaceSpec(obj) {
363451
363389
  'module': obj.module,
363452
363390
  'source': obj.source,
363453
363391
  'values': obj.values,
363454
- 'files': obj.files?.map(y => toJson_FirestartrTerraformWorkspaceSpecFiles(y)),
363455
363392
  'references': obj.references?.map(y => toJson_FirestartrTerraformWorkspaceSpecReferences(y)),
363456
363393
  'writeConnectionSecretToRef': toJson_FirestartrTerraformWorkspaceSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
363457
363394
  };
@@ -363498,21 +363435,6 @@ var FirestartrTerraformWorkspaceSpecSource;
363498
363435
  /** Inline */
363499
363436
  FirestartrTerraformWorkspaceSpecSource["INLINE"] = "Inline";
363500
363437
  })(FirestartrTerraformWorkspaceSpecSource || (FirestartrTerraformWorkspaceSpecSource = {}));
363501
- /**
363502
- * Converts an object of type 'FirestartrTerraformWorkspaceSpecFiles' to JSON representation.
363503
- */
363504
- /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
363505
- function toJson_FirestartrTerraformWorkspaceSpecFiles(obj) {
363506
- if (obj === undefined) {
363507
- return undefined;
363508
- }
363509
- const result = {
363510
- 'content': obj.content,
363511
- 'path': obj.path,
363512
- };
363513
- // filter undefined values
363514
- return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
363515
- }
363516
363438
  /**
363517
363439
  * Converts an object of type 'FirestartrTerraformWorkspaceSpecReferences' to JSON representation.
363518
363440
  */
@@ -372374,37 +372296,6 @@ class WriterProviderJson extends writer {
372374
372296
  }
372375
372297
  }
372376
372298
 
372377
- ;// CONCATENATED MODULE: ../terraform_provisioner/src/writer_additional_files.ts
372378
-
372379
-
372380
-
372381
- class WriterAdditionalFiles extends writer {
372382
- constructor(files) {
372383
- super();
372384
- this.files = files;
372385
- }
372386
- // this writer does not "write" anything per se
372387
- // it just complies with the abstract class it inherits from
372388
- async _render() {
372389
- return '';
372390
- }
372391
- async writeToTerraformProject(projectPath) {
372392
- for (const file of this.files) {
372393
- try {
372394
- const targetPath = external_path_.resolve(projectPath, file.path);
372395
- const absProjectPath = external_path_.resolve(projectPath);
372396
- if (!targetPath.startsWith(absProjectPath + external_path_.sep)) {
372397
- throw new Error(`Path traversal detected: ${file.path}`);
372398
- }
372399
- await external_fs_promises_.writeFile(targetPath, Buffer.from(file.content, 'base64').toString('utf8'));
372400
- }
372401
- catch (err) {
372402
- throw new Error(`Error writing additional file: ${file.path}: ${err}`);
372403
- }
372404
- }
372405
- }
372406
- }
372407
-
372408
372299
  ;// CONCATENATED MODULE: ../terraform_provisioner/src/project_tf.ts
372409
372300
 
372410
372301
 
@@ -372412,7 +372303,6 @@ class WriterAdditionalFiles extends writer {
372412
372303
 
372413
372304
 
372414
372305
 
372415
-
372416
372306
  class project_tf_TFProjectManager {
372417
372307
  constructor(ctx) {
372418
372308
  this.tfOutput = '';
@@ -372420,9 +372310,6 @@ class project_tf_TFProjectManager {
372420
372310
  this.mainTfWriter = new WriterMainTf(ctx.inline, ctx.requiredProviders, ctx.backend, ctx.tfStateKey);
372421
372311
  this.providerJsonWriter = new WriterProviderJson(ctx.inline, ctx.requiredProviders, ctx.backend, ctx.tfStateKey);
372422
372312
  this.tfVarsJsonWriter = new WriterTfVarsJson(ctx.values, ctx.references);
372423
- if ('files' in ctx) {
372424
- this.additionalFilesWriter = new WriterAdditionalFiles(ctx['files']);
372425
- }
372426
372313
  this.secrets = ctx.secrets;
372427
372314
  }
372428
372315
  setStreamCallbacks(fnData, fnEnd, reopen = true) {
@@ -372443,10 +372330,6 @@ class project_tf_TFProjectManager {
372443
372330
  this.providerJsonWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'firestartr-providers.tf.json'));
372444
372331
  await this.tfVarsJsonWriter.render();
372445
372332
  this.tfVarsJsonWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'terraform.tfvars.json'));
372446
- if (this.additionalFilesWriter) {
372447
- await this.additionalFilesWriter.render();
372448
- await this.additionalFilesWriter.writeToTerraformProject(this.projectPath);
372449
- }
372450
372333
  }
372451
372334
  async __init() {
372452
372335
  this.tfOutput += await init(this.projectPath, this.secrets, this.stream);
@@ -372578,7 +372461,6 @@ var lib_ajv_default = /*#__PURE__*/__nccwpck_require__.n(lib_ajv);
372578
372461
 
372579
372462
 
372580
372463
 
372581
-
372582
372464
  class TFProjectManagerRemote {
372583
372465
  constructor(ctx) {
372584
372466
  this.tfOutput = '';
@@ -372587,9 +372469,6 @@ class TFProjectManagerRemote {
372587
372469
  this.secrets = ctx.secrets;
372588
372470
  this.writerTerraform = new WriterTerraform(ctx.requiredProviders, ctx.backend, ctx.tfStateKey, false);
372589
372471
  this.providerJsonWriter = new WriterProviderJson(ctx.inline, ctx.requiredProviders, ctx.backend, ctx.tfStateKey);
372590
- if ('files' in ctx) {
372591
- this.additionalFilesWriter = new WriterAdditionalFiles(ctx['files']);
372592
- }
372593
372472
  this.tfVarsJsonWriter = new WriterTfVarsJson(ctx.values, ctx.references);
372594
372473
  }
372595
372474
  getOutput() {
@@ -372613,10 +372492,6 @@ class TFProjectManagerRemote {
372613
372492
  this.providerJsonWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'firestartr-providers.tf.json'));
372614
372493
  await this.tfVarsJsonWriter.render();
372615
372494
  this.tfVarsJsonWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'terraform.tfvars.json'));
372616
- if (this.additionalFilesWriter) {
372617
- await this.additionalFilesWriter.render();
372618
- await this.additionalFilesWriter.writeToTerraformProject(this.projectPath);
372619
- }
372620
372495
  }
372621
372496
  async __configGit() {
372622
372497
  external_fs_.existsSync('/home/node/.gitconfig') &&
@@ -373527,9 +373402,6 @@ function buildProvisionerContext(item, deps) {
373527
373402
  context['type'] = item.spec.source;
373528
373403
  context['inline'] = item.spec.module;
373529
373404
  context['module'] = item.spec.module;
373530
- if ('files' in item.spec) {
373531
- context['files'] = item.spec.files;
373532
- }
373533
373405
  context['values'] = JSON.parse(item.spec.values);
373534
373406
  const result = adaptProviders(item, deps);
373535
373407
  context['requiredProviders'] = result.providers;
@@ -2308,12 +2308,6 @@ export interface FirestartrTerraformWorkspaceSpec {
2308
2308
  * @schema FirestartrTerraformWorkspaceSpec#values
2309
2309
  */
2310
2310
  readonly values?: string;
2311
- /**
2312
- * A list of files to be created in the Terraform workspace directory.
2313
- *
2314
- * @schema FirestartrTerraformWorkspaceSpec#files
2315
- */
2316
- readonly files?: FirestartrTerraformWorkspaceSpecFiles[];
2317
2311
  /**
2318
2312
  * @schema FirestartrTerraformWorkspaceSpec#references
2319
2313
  */
@@ -2366,27 +2360,6 @@ export declare enum FirestartrTerraformWorkspaceSpecSource {
2366
2360
  /** Inline */
2367
2361
  INLINE = "Inline"
2368
2362
  }
2369
- /**
2370
- * @schema FirestartrTerraformWorkspaceSpecFiles
2371
- */
2372
- export interface FirestartrTerraformWorkspaceSpecFiles {
2373
- /**
2374
- * The base64 encoded content of the file.
2375
- *
2376
- * @schema FirestartrTerraformWorkspaceSpecFiles#content
2377
- */
2378
- readonly content: string;
2379
- /**
2380
- * The target relative path for the file within the Terraform workspace directory.
2381
- *
2382
- * @schema FirestartrTerraformWorkspaceSpecFiles#path
2383
- */
2384
- readonly path: string;
2385
- }
2386
- /**
2387
- * Converts an object of type 'FirestartrTerraformWorkspaceSpecFiles' to JSON representation.
2388
- */
2389
- export declare function toJson_FirestartrTerraformWorkspaceSpecFiles(obj: FirestartrTerraformWorkspaceSpecFiles | undefined): Record<string, any> | undefined;
2390
2363
  /**
2391
2364
  * @schema FirestartrTerraformWorkspaceSpecReferences
2392
2365
  */
@@ -20,7 +20,6 @@ export declare class CatalogTFWorkspaceChart extends BaseCatalogChart {
20
20
  source: import("../../../imports/firestartr.dev").FirestartrTerraformWorkspaceSpecSource;
21
21
  module: string;
22
22
  values: any;
23
- files: import("../../claims/tfworkspaces/tfworkspace").TerraformProviderAdditionalFiles;
24
23
  context: {
25
24
  providers: {
26
25
  name: string;
@@ -659,26 +659,6 @@ declare const schemas: {
659
659
  })[] | {
660
660
  $id: string;
661
661
  definitions: {
662
- TerraformProviderFiles: {
663
- $id: string;
664
- description: string;
665
- type: string;
666
- items: {
667
- type: string;
668
- properties: {
669
- source: {
670
- type: string;
671
- description: string;
672
- };
673
- destination: {
674
- type: string;
675
- description: string;
676
- };
677
- };
678
- additionalProperties: boolean;
679
- required: string[];
680
- };
681
- };
682
662
  TerraformProvider: {
683
663
  $id: string;
684
664
  type: string;
@@ -702,9 +682,6 @@ declare const schemas: {
702
682
  type: string;
703
683
  enum: string[];
704
684
  };
705
- files: {
706
- $ref: string;
707
- };
708
685
  sync: {
709
686
  type: string;
710
687
  properties: {
@@ -1,26 +1,6 @@
1
1
  export declare const TerraformSchemas: {
2
2
  $id: string;
3
3
  definitions: {
4
- TerraformProviderFiles: {
5
- $id: string;
6
- description: string;
7
- type: string;
8
- items: {
9
- type: string;
10
- properties: {
11
- source: {
12
- type: string;
13
- description: string;
14
- };
15
- destination: {
16
- type: string;
17
- description: string;
18
- };
19
- };
20
- additionalProperties: boolean;
21
- required: string[];
22
- };
23
- };
24
4
  TerraformProvider: {
25
5
  $id: string;
26
6
  type: string;
@@ -44,9 +24,6 @@ export declare const TerraformSchemas: {
44
24
  type: string;
45
25
  enum: string[];
46
26
  };
47
- files: {
48
- $ref: string;
49
- };
50
27
  sync: {
51
28
  type: string;
52
29
  properties: {
@@ -1,26 +1,6 @@
1
1
  declare const _default: {
2
2
  $id: string;
3
3
  definitions: {
4
- TerraformProviderFiles: {
5
- $id: string;
6
- description: string;
7
- type: string;
8
- items: {
9
- type: string;
10
- properties: {
11
- source: {
12
- type: string;
13
- description: string;
14
- };
15
- destination: {
16
- type: string;
17
- description: string;
18
- };
19
- };
20
- additionalProperties: boolean;
21
- required: string[];
22
- };
23
- };
24
4
  TerraformProvider: {
25
5
  $id: string;
26
6
  type: string;
@@ -44,9 +24,6 @@ declare const _default: {
44
24
  type: string;
45
25
  enum: string[];
46
26
  };
47
- files: {
48
- $ref: string;
49
- };
50
27
  sync: {
51
28
  type: string;
52
29
  properties: {
@@ -1,10 +1,5 @@
1
1
  import { FirestartrTerraformWorkspaceSpecSource } from '../../../imports/firestartr.dev';
2
2
  import { Workspace } from '../base/workspace';
3
- export interface TerraformProviderAdditionalFile {
4
- source: string;
5
- destination: string;
6
- }
7
- export type TerraformProviderAdditionalFiles = TerraformProviderAdditionalFile[];
8
3
  export interface TFWorkspace extends Workspace {
9
4
  kind: 'TFWorkspaceClaim';
10
5
  resourceType: string;
@@ -15,7 +10,6 @@ export interface TFWorkspace extends Workspace {
15
10
  source: FirestartrTerraformWorkspaceSpecSource.INLINE | FirestartrTerraformWorkspaceSpecSource.REMOTE;
16
11
  module: string;
17
12
  values: any;
18
- files: TerraformProviderAdditionalFiles;
19
13
  context: {
20
14
  providers: {
21
15
  name: string;
@@ -2,13 +2,11 @@
2
2
  import { WriterMainTf } from './writer_main_tf';
3
3
  import { WriterTfVarsJson } from './writer_tfvars_json';
4
4
  import { WriterProviderJson } from './writer_provider_tf_json';
5
- import { WriterAdditionalFiles } from './writer_additional_files';
6
5
  import { PassThrough } from 'stream';
7
6
  export declare class TFProjectManager {
8
7
  mainTfWriter: WriterMainTf;
9
8
  providerJsonWriter: WriterProviderJson;
10
9
  tfVarsJsonWriter: WriterTfVarsJson;
11
- additionalFilesWriter: WriterAdditionalFiles;
12
10
  secrets: any[];
13
11
  projectPath: string;
14
12
  tfOutput: any;
@@ -2,13 +2,11 @@
2
2
  import { WriterTerraform } from './writer_terraform';
3
3
  import { WriterTfVarsJson } from './writer_tfvars_json';
4
4
  import { WriterProviderJson } from './writer_provider_tf_json';
5
- import { WriterAdditionalFiles } from './writer_additional_files';
6
5
  import { PassThrough } from 'stream';
7
6
  export declare class TFProjectManagerRemote {
8
7
  writerTerraform: WriterTerraform;
9
8
  providerJsonWriter: WriterProviderJson;
10
9
  tfVarsJsonWriter: WriterTfVarsJson;
11
- additionalFilesWriter: WriterAdditionalFiles;
12
10
  ctx: any;
13
11
  secrets: any[];
14
12
  projectPath: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.54.0-snapshot-7",
3
+ "version": "1.54.0-snapshot-10",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",
@@ -1,13 +0,0 @@
1
- import Writer from './writer';
2
- export interface FirestartrTerraformWorkspaceSpecFile {
3
- content: string;
4
- path: string;
5
- }
6
- type FirestartrTerraformWorkspaceSpecFiles = FirestartrTerraformWorkspaceSpecFile[];
7
- export declare class WriterAdditionalFiles extends Writer {
8
- files: FirestartrTerraformWorkspaceSpecFile[];
9
- constructor(files: FirestartrTerraformWorkspaceSpecFiles);
10
- _render(): Promise<string>;
11
- writeToTerraformProject(projectPath: string): Promise<void>;
12
- }
13
- export {};