@firestartr/cli 1.54.0-snapshot-13 → 1.54.0

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
 
@@ -358145,10 +358145,26 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
358145
358145
  type: 'string',
358146
358146
  description: 'The github organization name',
358147
358147
  },
358148
+ name: {
358149
+ type: 'string',
358150
+ description: 'The github repo name',
358151
+ },
358152
+ orgPermissions: {
358153
+ type: 'string',
358154
+ description: 'The level of org Permission',
358155
+ },
358156
+ archiveOnDestroy: {
358157
+ type: 'boolean',
358158
+ description: 'whether this repo should be archived when the claim is deleted',
358159
+ },
358148
358160
  visibility: {
358149
358161
  type: 'string',
358150
358162
  enum: ['private', 'public', 'internal'],
358151
358163
  },
358164
+ description: {
358165
+ type: 'string',
358166
+ description: 'The purpose of this repo',
358167
+ },
358152
358168
  features: {
358153
358169
  type: 'array',
358154
358170
  items: {
@@ -367240,6 +367256,9 @@ const kindPluralMap = {
367240
367256
  providerconfigs: 'FirestartrProviderConfig',
367241
367257
  externalsecrets: 'ExternalSecret',
367242
367258
  secrets: 'Secret',
367259
+ fsdummiesa: 'FirestartrDummyA',
367260
+ fsdummiesb: 'FirestartrDummyB',
367261
+ fsdummiesc: 'FirestartrDummyC',
367243
367262
  };
367244
367263
  function getKindFromPlural(plural) {
367245
367264
  return kindPluralMap[plural];
@@ -368535,6 +368554,9 @@ var WorkStatus;
368535
368554
 
368536
368555
 
368537
368556
  const kindsWithFinalizer = [
368557
+ 'FirestartrDummyA',
368558
+ 'FirestartrDummyB',
368559
+ 'FirestartrDummyC',
368538
368560
  'FirestartrTerraformWorkspace',
368539
368561
  'FirestartrGithubGroup',
368540
368562
  'FirestartrGithubMembership',
@@ -368904,6 +368926,255 @@ function dummy_fWait(ms) {
368904
368926
  });
368905
368927
  }
368906
368928
 
368929
+ ;// CONCATENATED MODULE: ../operator/fdummies/index.ts
368930
+
368931
+
368932
+
368933
+ function processFirestartrDummies(item, op, handler) {
368934
+ operator_src_logger.info(`FirestartrDummies Processor: ${op}`);
368935
+ try {
368936
+ switch (op) {
368937
+ case OperationType.UPDATED:
368938
+ return updated(item, op, handler);
368939
+ case OperationType.CREATED:
368940
+ return created(item, op, handler);
368941
+ case OperationType.RENAMED:
368942
+ return renamed();
368943
+ case OperationType.MARKED_TO_DELETION:
368944
+ return marked(item, op, handler);
368945
+ case OperationType.RETRY:
368946
+ return fdummies_retry();
368947
+ case OperationType.NOTHING:
368948
+ return nothing();
368949
+ default:
368950
+ throw new Error(`Operation ${op} not supported`);
368951
+ }
368952
+ }
368953
+ catch (e) {
368954
+ operator_src_logger.error(`The Dummy processor encountered an error during operation '${op}': '${e}'.`);
368955
+ throw e;
368956
+ }
368957
+ }
368958
+ async function* updated(item, op, handler) {
368959
+ operator_src_logger.info(`Updated op in ${item.kind}/${item.metadata.name}`);
368960
+ for await (const transition of doRun(item, op, handler)) {
368961
+ yield transition;
368962
+ }
368963
+ }
368964
+ async function* created(item, op, handler) {
368965
+ for await (const transition of doRun(item, op, handler)) {
368966
+ yield transition;
368967
+ }
368968
+ }
368969
+ async function renamed() {
368970
+ throw new Error('Renamed operation not prepared');
368971
+ }
368972
+ async function* sync(item, op, handler) {
368973
+ for await (const transition of doRun(item, op, handler)) {
368974
+ yield transition;
368975
+ }
368976
+ }
368977
+ async function* marked(item, op, handler) {
368978
+ for await (const transition of markedToDeletion(item, op, handler)) {
368979
+ yield transition;
368980
+ }
368981
+ }
368982
+ async function* fdummies_retry() { }
368983
+ async function* nothing() { }
368984
+ async function* markedToDeletion(item, op, handler) {
368985
+ let error = false;
368986
+ try {
368987
+ const type = 'DELETING';
368988
+ yield {
368989
+ item,
368990
+ reason: op,
368991
+ type: 'PROVISIONING',
368992
+ status: 'False',
368993
+ message: 'markedToDeletion',
368994
+ };
368995
+ yield {
368996
+ item,
368997
+ reason: op,
368998
+ type: 'DELETED',
368999
+ status: 'False',
369000
+ message: 'markedToDeletion',
369001
+ };
369002
+ yield {
369003
+ item,
369004
+ reason: op,
369005
+ type: 'PLANNING',
369006
+ status: 'False',
369007
+ message: 'markedToDeletion',
369008
+ };
369009
+ yield {
369010
+ item,
369011
+ reason: op,
369012
+ type: 'OUT_OF_SYNC',
369013
+ status: 'False',
369014
+ message: 'markedToDeletion',
369015
+ };
369016
+ yield {
369017
+ item,
369018
+ reason: op,
369019
+ type: 'ERROR',
369020
+ status: 'False',
369021
+ message: 'doApply',
369022
+ };
369023
+ yield {
369024
+ item,
369025
+ reason: op,
369026
+ type: 'PROVISIONED',
369027
+ status: 'False',
369028
+ message: 'Synth CDKTF',
369029
+ };
369030
+ yield {
369031
+ item,
369032
+ reason: op,
369033
+ type,
369034
+ status: 'True',
369035
+ message: 'Destroying process started',
369036
+ };
369037
+ await handler.resolveReferences();
369038
+ await processDummy(item);
369039
+ yield {
369040
+ item,
369041
+ reason: op,
369042
+ type,
369043
+ status: 'False',
369044
+ message: 'Destroying process finished',
369045
+ };
369046
+ yield {
369047
+ item,
369048
+ reason: op,
369049
+ type: 'DELETED',
369050
+ status: 'True',
369051
+ message: 'destroyed',
369052
+ };
369053
+ await handler.finalize(handler.pluralKind, item.metadata.namespace, item, 'firestartr.dev/finalizer');
369054
+ void handler.success();
369055
+ }
369056
+ catch (e) {
369057
+ error = true;
369058
+ void handler.error();
369059
+ }
369060
+ finally {
369061
+ if (error) {
369062
+ yield {
369063
+ item,
369064
+ reason: op,
369065
+ type: 'ERROR',
369066
+ status: 'True',
369067
+ message: DESTROY_DEFAULT_ERROR_MESSAGE,
369068
+ };
369069
+ }
369070
+ }
369071
+ }
369072
+ async function* doRun(item, op, handler) {
369073
+ let error = false;
369074
+ try {
369075
+ yield {
369076
+ item,
369077
+ reason: op,
369078
+ type: 'DELETED',
369079
+ status: 'False',
369080
+ message: 'markedToDeletion',
369081
+ };
369082
+ yield {
369083
+ item,
369084
+ reason: op,
369085
+ type: 'ERROR',
369086
+ status: 'False',
369087
+ message: 'doRun',
369088
+ };
369089
+ yield {
369090
+ item,
369091
+ reason: op,
369092
+ type: 'PROVISIONED',
369093
+ status: 'False',
369094
+ message: 'Run processor',
369095
+ };
369096
+ //let output = '';
369097
+ const type = 'PROVISIONING';
369098
+ yield {
369099
+ item,
369100
+ reason: op,
369101
+ type,
369102
+ status: 'True',
369103
+ message: 'Provisioning process started',
369104
+ };
369105
+ const deps = await handler.resolveReferences();
369106
+ operator_src_logger.info(`The dummy processor is applying and assessing dependencies for item '${item.kind}/${item.metadata.name}' with dependencies: '${deps}'.`);
369107
+ await processDummy(item);
369108
+ yield {
369109
+ item,
369110
+ reason: op,
369111
+ type,
369112
+ status: 'False',
369113
+ message: 'Dummy Processor apply finished',
369114
+ };
369115
+ yield {
369116
+ item,
369117
+ reason: op,
369118
+ type: 'PROVISIONED',
369119
+ status: 'True',
369120
+ message: 'Dummy Processor apply finished',
369121
+ };
369122
+ yield {
369123
+ item,
369124
+ reason: op,
369125
+ type: 'ERROR',
369126
+ status: 'False',
369127
+ message: 'doApply',
369128
+ };
369129
+ await handler.success();
369130
+ }
369131
+ catch (e) {
369132
+ error = true;
369133
+ console.error(e);
369134
+ operator_src_logger.error(`The Dummy processor encountered an error during operation '${op}' for item '${item.kind}/${item.metadata.name}': '${e}'.`);
369135
+ await handler.error();
369136
+ }
369137
+ finally {
369138
+ if (error) {
369139
+ yield {
369140
+ item,
369141
+ reason: op,
369142
+ type: 'ERROR',
369143
+ status: 'True',
369144
+ message: APPLY_DEFAULT_ERROR_MESSAGE,
369145
+ };
369146
+ yield {
369147
+ item,
369148
+ reason: op,
369149
+ type: 'PROVISIONED',
369150
+ status: 'False',
369151
+ message: APPLY_DEFAULT_ERROR_MESSAGE,
369152
+ };
369153
+ yield {
369154
+ item,
369155
+ reason: op,
369156
+ type: 'PROVISIONING',
369157
+ status: 'False',
369158
+ message: APPLY_DEFAULT_ERROR_MESSAGE,
369159
+ };
369160
+ }
369161
+ }
369162
+ }
369163
+ async function processDummy(item) {
369164
+ const s = item.spec?.computation?.numberOfSeconds;
369165
+ operator_src_logger.info(`Processing dummy ${item.kind}/${item.metadata.name}: computing for ${s} seconds`);
369166
+ if (!s)
369167
+ throw new Error('Unprocessable dummy: missing seconds section');
369168
+ await fdummies_fWait(s * 1000);
369169
+ }
369170
+ function fdummies_fWait(ms) {
369171
+ return new Promise((resolve) => {
369172
+ setTimeout(() => {
369173
+ resolve();
369174
+ }, ms);
369175
+ });
369176
+ }
369177
+
368907
369178
  ;// CONCATENATED MODULE: ../operator/src/processItem.debug.ts
368908
369179
 
368909
369180
 
@@ -369469,7 +369740,7 @@ function provisionRepository(scope, fsGithubRepository) {
369469
369740
  allowAutoMerge: fsGithubRepository.spec.repo.allowAutoMerge,
369470
369741
  deleteBranchOnMerge: fsGithubRepository.spec.repo.deleteBranchOnMerge,
369471
369742
  autoInit: fsGithubRepository.spec.repo.autoInit,
369472
- archiveOnDestroy: true,
369743
+ archiveOnDestroy: fsGithubRepository.spec.repo.archiveOnDestroy,
369473
369744
  allowUpdateBranch: fsGithubRepository.spec.repo.allowUpdateBranch,
369474
369745
  hasIssues: fsGithubRepository.spec.repo.hasIssues,
369475
369746
  visibility: fsGithubRepository.spec.repo.visibility,
@@ -371407,19 +371678,19 @@ function processOperation(item, op, handler) {
371407
371678
  try {
371408
371679
  switch (op) {
371409
371680
  case OperationType.UPDATED:
371410
- return updated(item, op, handler);
371681
+ return cdktf_updated(item, op, handler);
371411
371682
  case OperationType.CREATED:
371412
- return created(item, op, handler);
371683
+ return cdktf_created(item, op, handler);
371413
371684
  case OperationType.RENAMED:
371414
- return renamed(item, op, handler);
371685
+ return cdktf_renamed(item, op, handler);
371415
371686
  case OperationType.SYNC:
371416
- return sync(item, op, handler);
371687
+ return cdktf_sync(item, op, handler);
371417
371688
  case OperationType.MARKED_TO_DELETION:
371418
- return markedToDeletion(item, op, handler);
371689
+ return cdktf_markedToDeletion(item, op, handler);
371419
371690
  case OperationType.RETRY:
371420
371691
  return cdktf_retry(item, op, handler);
371421
371692
  case OperationType.NOTHING:
371422
- return nothing(item, op, handler);
371693
+ return cdktf_nothing(item, op, handler);
371423
371694
  default:
371424
371695
  throw new Error(`Operation ${op} not supported`);
371425
371696
  }
@@ -371429,24 +371700,24 @@ function processOperation(item, op, handler) {
371429
371700
  throw e;
371430
371701
  }
371431
371702
  }
371432
- async function* created(item, op, handler) {
371703
+ async function* cdktf_created(item, op, handler) {
371433
371704
  for await (const transition of doApply(item, op, handler)) {
371434
371705
  yield transition;
371435
371706
  }
371436
371707
  }
371437
- async function* renamed(item, op, handler) {
371708
+ async function* cdktf_renamed(item, op, handler) {
371438
371709
  for await (const transition of doApply(item, op, handler)) {
371439
371710
  yield transition;
371440
371711
  }
371441
371712
  }
371442
- async function* updated(item, op, handler) {
371713
+ async function* cdktf_updated(item, op, handler) {
371443
371714
  for await (const transition of doApply(item, op, handler)) {
371444
371715
  yield transition;
371445
371716
  }
371446
371717
  }
371447
371718
  async function* cdktf_retry(item, op, handler) {
371448
371719
  if ('deletionTimestamp' in item.metadata) {
371449
- for await (const transition of markedToDeletion(item, op, handler)) {
371720
+ for await (const transition of cdktf_markedToDeletion(item, op, handler)) {
371450
371721
  yield transition;
371451
371722
  }
371452
371723
  }
@@ -371456,7 +371727,7 @@ async function* cdktf_retry(item, op, handler) {
371456
371727
  }
371457
371728
  }
371458
371729
  }
371459
- async function* sync(item, op, handler) {
371730
+ async function* cdktf_sync(item, op, handler) {
371460
371731
  yield {
371461
371732
  item,
371462
371733
  reason: op,
@@ -371475,7 +371746,7 @@ async function* sync(item, op, handler) {
371475
371746
  message: 'terraform execution finished',
371476
371747
  };
371477
371748
  }
371478
- async function* markedToDeletion(item, op, handler) {
371749
+ async function* cdktf_markedToDeletion(item, op, handler) {
371479
371750
  // here we store the current callbacks that
371480
371751
  // are being used (synth|tf-apply...)
371481
371752
  let checkRunCtl;
@@ -371574,7 +371845,7 @@ async function* markedToDeletion(item, op, handler) {
371574
371845
  }
371575
371846
  }
371576
371847
  }
371577
- async function* nothing(item, op, handler) {
371848
+ async function* cdktf_nothing(item, op, handler) {
371578
371849
  yield {
371579
371850
  item,
371580
371851
  reason: op,
@@ -372383,8 +372654,7 @@ class WriterAdditionalFiles extends writer {
372383
372654
  super();
372384
372655
  this.files = files;
372385
372656
  }
372386
- // this writer does not "write" anything per se
372387
- // it just complies with the abstract class it inherits from
372657
+ // This writer complies with the abstract Writer class but does not render content in the traditional sense.
372388
372658
  async _render() {
372389
372659
  return '';
372390
372660
  }
@@ -374996,6 +375266,7 @@ async function tfLocal(cr, namespace, cmd = 'plan') {
374996
375266
 
374997
375267
 
374998
375268
 
375269
+
374999
375270
  let importModeActive = false;
375000
375271
  let withMetricsMode = false;
375001
375272
 
@@ -375070,6 +375341,11 @@ function getProvisionImplementation(plural) {
375070
375341
  case 'githubrepositorysecretssections':
375071
375342
  implementation = processOperation;
375072
375343
  break;
375344
+ case 'fsdummiesa':
375345
+ case 'fsdummiesb':
375346
+ case 'fsdummiesc':
375347
+ implementation = processFirestartrDummies;
375348
+ break;
375073
375349
  }
375074
375350
  if (!implementation)
375075
375351
  throw new Error(`No implementation found for ${plural}`);
@@ -489,10 +489,26 @@ declare const schemas: {
489
489
  type: string;
490
490
  description: string;
491
491
  };
492
+ name: {
493
+ type: string;
494
+ description: string;
495
+ };
496
+ orgPermissions: {
497
+ type: string;
498
+ description: string;
499
+ };
500
+ archiveOnDestroy: {
501
+ type: string;
502
+ description: string;
503
+ };
492
504
  visibility: {
493
505
  type: string;
494
506
  enum: string[];
495
507
  };
508
+ description: {
509
+ type: string;
510
+ description: string;
511
+ };
496
512
  features: {
497
513
  type: string;
498
514
  items: {
@@ -19,10 +19,26 @@ declare const _default: {
19
19
  type: string;
20
20
  description: string;
21
21
  };
22
+ name: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ orgPermissions: {
27
+ type: string;
28
+ description: string;
29
+ };
30
+ archiveOnDestroy: {
31
+ type: string;
32
+ description: string;
33
+ };
22
34
  visibility: {
23
35
  type: string;
24
36
  enum: string[];
25
37
  };
38
+ description: {
39
+ type: string;
40
+ description: string;
41
+ };
26
42
  features: {
27
43
  type: string;
28
44
  items: {
@@ -124,10 +124,26 @@ export declare const GithubSchemas: ({
124
124
  type: string;
125
125
  description: string;
126
126
  };
127
+ name: {
128
+ type: string;
129
+ description: string;
130
+ };
131
+ orgPermissions: {
132
+ type: string;
133
+ description: string;
134
+ };
135
+ archiveOnDestroy: {
136
+ type: string;
137
+ description: string;
138
+ };
127
139
  visibility: {
128
140
  type: string;
129
141
  enum: string[];
130
142
  };
143
+ description: {
144
+ type: string;
145
+ description: string;
146
+ };
131
147
  features: {
132
148
  type: string;
133
149
  items: {
@@ -0,0 +1,8 @@
1
+ import { OperationType } from '../src/informer';
2
+ export declare function processFirestartrDummies(item: any, op: string, handler: any): Promise<void> | AsyncGenerator<{
3
+ item: any;
4
+ reason: OperationType;
5
+ type: string;
6
+ status: string;
7
+ message: string;
8
+ }, void, unknown>;
@@ -1,6 +1,17 @@
1
1
  import Writer from './writer';
2
+ /**
3
+ * Represents a file to be written to the Terraform workspace.
4
+ * @property content The file contents, base64-encoded. This will be decoded before writing to disk.
5
+ * @property path The relative path (from the project root) where the file should be written.
6
+ */
2
7
  export interface FirestartrTerraformWorkspaceSpecFile {
8
+ /**
9
+ * The file contents, base64-encoded. This will be decoded before writing to disk.
10
+ */
3
11
  content: string;
12
+ /**
13
+ * The relative path (from the project root) where the file should be written.
14
+ */
4
15
  path: string;
5
16
  }
6
17
  type FirestartrTerraformWorkspaceSpecFiles = FirestartrTerraformWorkspaceSpecFile[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.54.0-snapshot-13",
3
+ "version": "1.54.0",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",