@fractal_cloud/sdk 0.1.2 → 1.1.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/dist/index.cjs CHANGED
@@ -41,7 +41,12 @@ superagent = __toESM(superagent);
41
41
  *
42
42
  * @type {KebabCaseString}
43
43
  */
44
- const DEFAULT_KEBAB_CASE_STRING = { kebabValue: "" };
44
+ const DEFAULT_KEBAB_CASE_STRING = {
45
+ _type: "kebab",
46
+ value: "",
47
+ equals: () => false,
48
+ toString: () => ""
49
+ };
45
50
  /**
46
51
  * Validates whether a given string follows the kebab-case format.
47
52
  *
@@ -55,7 +60,7 @@ const DEFAULT_KEBAB_CASE_STRING = { kebabValue: "" };
55
60
  * @returns {string[]} - An empty array if the string is valid, otherwise an array containing an error message.
56
61
  */
57
62
  const isValidKebabCaseString = (value) => {
58
- if (!/^[a-z][a-z0-9]*(-[a-z][a-z0-9]*)*$/.test(value)) return ["Value must be in kebab-case"];
63
+ if (!/^[a-z][a-z0-9]*(-[a-z][a-z0-9]*)*$/.test(value)) return [` Value '${value}' must be in kebab-case`];
59
64
  return [];
60
65
  };
61
66
  /**
@@ -72,17 +77,21 @@ const getKebabCaseStringBuilder = () => {
72
77
  const internalState = { ...DEFAULT_KEBAB_CASE_STRING };
73
78
  const builder = {
74
79
  withValue: (value) => {
75
- internalState.kebabValue = value;
80
+ internalState.value = value;
76
81
  return builder;
77
82
  },
78
83
  reset: () => {
79
- internalState.kebabValue = DEFAULT_KEBAB_CASE_STRING.kebabValue;
84
+ internalState.value = DEFAULT_KEBAB_CASE_STRING.value;
80
85
  return builder;
81
86
  },
82
87
  build: () => {
83
- const validationErrors = isValidKebabCaseString(internalState.kebabValue);
88
+ const validationErrors = isValidKebabCaseString(internalState.value);
84
89
  if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
85
- return { ...internalState };
90
+ return {
91
+ ...internalState,
92
+ equals: (other) => internalState.value === other.value,
93
+ toString: () => internalState.value
94
+ };
86
95
  }
87
96
  };
88
97
  return builder;
@@ -94,8 +103,8 @@ let KebabCaseString$1;
94
103
 
95
104
  //#endregion
96
105
  //#region src/values/version.ts
97
- const equals$2 = (a, b) => a.major === b.major && a.minor === b.minor && a.patch === b.patch;
98
- const toString$1 = (version) => `v${version.major}.${version.minor}.${version.patch}`;
106
+ const equals$4 = (a, b) => a.major === b.major && a.minor === b.minor && a.patch === b.patch;
107
+ const toString$2 = (version) => `v${version.major}.${version.minor}.${version.patch}`;
99
108
  /**
100
109
  * Represents the default version for an application or library.
101
110
  *
@@ -106,7 +115,7 @@ const DEFAULT_VERSION = {
106
115
  major: 0,
107
116
  minor: 0,
108
117
  patch: 0,
109
- equals: (other) => equals$2(DEFAULT_VERSION, other)
118
+ equals: (other) => equals$4(DEFAULT_VERSION, other)
110
119
  };
111
120
  /**
112
121
  * Validates if the provided version object is properly initialized or equivalent to the default version.
@@ -116,7 +125,7 @@ const DEFAULT_VERSION = {
116
125
  * an array containing one error message. Otherwise, it returns an empty array.
117
126
  */
118
127
  const isValidVersion = (version) => {
119
- if (equals$2(version, DEFAULT_VERSION)) return ["Version must be initialized"];
128
+ if (equals$4(version, DEFAULT_VERSION)) return [" Version must be initialized"];
120
129
  return [];
121
130
  };
122
131
  /**
@@ -173,8 +182,8 @@ const getVersionBuilder = () => {
173
182
  if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
174
183
  const builtVersion = {
175
184
  ...internalState,
176
- equals: (other) => equals$2(builtVersion, other),
177
- toString: () => toString$1(builtVersion)
185
+ equals: (other) => equals$4(builtVersion, other),
186
+ toString: () => toString$2(builtVersion)
178
187
  };
179
188
  return builtVersion;
180
189
  }
@@ -208,7 +217,7 @@ let OwnerType$1 = /* @__PURE__ */ function(OwnerType) {
208
217
  //#endregion
209
218
  //#region src/values/guid.ts
210
219
  const isValidUuid = (value) => {
211
- if (!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(value)) return [`Value '${value}' must be a valid uuid`];
220
+ if (!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(value)) return [` Value '${value}' must be a valid uuid`];
212
221
  return [];
213
222
  };
214
223
 
@@ -220,7 +229,11 @@ const isValidUuid = (value) => {
220
229
  * This variable is declared as a constant to prevent modification
221
230
  * and is designed to not pass validation checks.
222
231
  */
223
- const DEFAULT_OWNER_ID = { ownerIdValue: "" };
232
+ const DEFAULT_OWNER_ID = {
233
+ _type: "ownerId",
234
+ value: "",
235
+ toString: () => ""
236
+ };
224
237
  /**
225
238
  * Validates whether the given string value is a valid UUID.
226
239
  *
@@ -232,8 +245,11 @@ const DEFAULT_OWNER_ID = { ownerIdValue: "" };
232
245
  * @returns {string[]} An array containing error messages if invalid, or an empty array if valid.
233
246
  */
234
247
  const isValidOwnerId = (value) => {
235
- if (!value || !value.ownerIdValue) return ["Value must be a non-empty string"];
236
- return isValidUuid(value.ownerIdValue);
248
+ if (!value || !value.value) return ["[Owner Id] Value must be a non-empty string"];
249
+ return addContextToErrors$8(value, isValidUuid(value.value));
250
+ };
251
+ const addContextToErrors$8 = (value, errors) => {
252
+ return errors.map((error) => `[Owner Id: ${value.toString()}]${error}`);
237
253
  };
238
254
  /**
239
255
  * Creates a builder for constructing a OwnerId object. The builder enforces uuid case formatting and ensures
@@ -249,17 +265,20 @@ const getOwnerIdBuilder = () => {
249
265
  const internalState = { ...DEFAULT_OWNER_ID };
250
266
  const builder = {
251
267
  withValue: (value) => {
252
- internalState.ownerIdValue = value;
268
+ internalState.value = value;
253
269
  return builder;
254
270
  },
255
271
  reset: () => {
256
- internalState.ownerIdValue = DEFAULT_OWNER_ID.ownerIdValue;
272
+ internalState.value = DEFAULT_OWNER_ID.value;
257
273
  return builder;
258
274
  },
259
275
  build: () => {
260
276
  const validationErrors = isValidOwnerId(internalState);
261
277
  if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
262
- return { ...internalState };
278
+ return {
279
+ ...internalState,
280
+ toString: () => internalState.value
281
+ };
263
282
  }
264
283
  };
265
284
  return builder;
@@ -271,17 +290,18 @@ let OwnerId$1;
271
290
 
272
291
  //#endregion
273
292
  //#region src/bounded_context/id.ts
274
- const equals$1 = (a, b) => a.ownerType === b.ownerType && a.ownerId.ownerIdValue === b.ownerId.ownerIdValue && a.name.kebabValue === b.name.kebabValue;
293
+ const equals$3 = (a, b) => a.ownerType === b.ownerType && a.ownerId.value === b.ownerId.value && a.name.value === b.name.value;
275
294
  /**
276
295
  * A default value for the bounded context identifier used in the system.
277
296
  * It contains values that will not pass validation checks.
278
297
  */
279
298
  const DEFAULT_BOUNDED_CONTEXT_ID = {
299
+ _type: "bounded_context",
280
300
  ownerType: OwnerType$1.Personal,
281
301
  ownerId: DEFAULT_OWNER_ID,
282
302
  name: DEFAULT_KEBAB_CASE_STRING,
283
- equals: (other) => equals$1(DEFAULT_BOUNDED_CONTEXT_ID, other),
284
- toString: () => boundedContextIdToString(DEFAULT_BOUNDED_CONTEXT_ID)
303
+ equals: () => false,
304
+ toString: () => ""
285
305
  };
286
306
  /**
287
307
  * Determines whether the given value is a valid Id.
@@ -296,11 +316,14 @@ const DEFAULT_BOUNDED_CONTEXT_ID = {
296
316
  * the `isValidKebabCaseString` function.
297
317
  */
298
318
  const isValidBoundedContextId = (value) => {
299
- const ownerIdErrors = isValidOwnerId(value.ownerId);
300
- const nameErrors = isValidKebabCaseString(value.name.kebabValue);
301
- return [...ownerIdErrors.map((x) => `[Bounded Context Id: ${boundedContextIdToString(value)}] Owner Id error: ${x}`), ...nameErrors.map((x) => `[Bounded Context Id: ${boundedContextIdToString(value)}] Name error: ${x}`)];
319
+ const ownerIdErrors = addContextToErrors$7(value, isValidOwnerId(value.ownerId));
320
+ const nameErrors = addContextToErrors$7(value, isValidKebabCaseString(value.name.value));
321
+ return [...ownerIdErrors, ...nameErrors];
322
+ };
323
+ const addContextToErrors$7 = (bcId, errors) => {
324
+ return errors.map((error) => `[Bounded Context Id: ${bcId.toString()}]${error}`);
302
325
  };
303
- const boundedContextIdToString = (id) => `${id.ownerType.toString()}/${id.ownerId.ownerIdValue}/${id.name.kebabValue}`;
326
+ const boundedContextIdToString = (id) => `${id.ownerType.toString()}/${id.ownerId.value}/${id.name.value}`;
304
327
  /**
305
328
  * Creates and returns a builder for constructing a `Id` object.
306
329
  *
@@ -338,7 +361,7 @@ const getBoundedContextIdBuilder = () => {
338
361
  if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
339
362
  const builtId = {
340
363
  ...internalState,
341
- equals: (other) => equals$1(builtId, other),
364
+ equals: (other) => equals$3(builtId, other),
342
365
  toString: () => boundedContextIdToString(builtId)
343
366
  };
344
367
  return builtId;
@@ -349,7 +372,8 @@ const getBoundedContextIdBuilder = () => {
349
372
 
350
373
  //#endregion
351
374
  //#region src/fractal/id.ts
352
- const toString = (id) => `${id.boundedContextId.toString()}/${id.name.kebabValue}:${id.version.toString()}`;
375
+ const equals$2 = (a, b) => a.boundedContextId.equals(b.boundedContextId) && a.name.equals(b.name) && a.version.equals(b.version);
376
+ const toString$1 = (id) => `${id.boundedContextId.toString()}/${id.name.toString()}:${id.version.toString()}`;
353
377
  /**
354
378
  * Validates a given Fractal ID and returns a list of error messages if any validation fails.
355
379
  * The validation process includes checking the bounded context ID, the name, and the version of the Fractal ID.
@@ -358,15 +382,18 @@ const toString = (id) => `${id.boundedContextId.toString()}/${id.name.kebabValue
358
382
  * @returns {string[]} An array of error messages. Each error message indicates the specific issue with the bounded context ID, name, or version of the Fractal ID.
359
383
  */
360
384
  const isValidFractalId = (id) => {
361
- const boundedContextIdErrors = isValidBoundedContextId(id.boundedContextId);
362
- const nameErrors = isValidKebabCaseString(id.name.kebabValue);
363
- const versionErrors = isValidVersion(id.version);
385
+ const boundedContextIdErrors = addContextToErrors$6(id, isValidBoundedContextId(id.boundedContextId));
386
+ const nameErrors = addContextToErrors$6(id, isValidKebabCaseString(id.name.value));
387
+ const versionErrors = addContextToErrors$6(id, isValidVersion(id.version));
364
388
  return [
365
- ...boundedContextIdErrors.map((x) => `[Fractal Id: ${id.toString()}] Bounded Context Id error: ${x}`),
366
- ...nameErrors.map((x) => `[Fractal Id: ${id.toString()}] Name errors: ${x}`),
367
- ...versionErrors.map((x) => `[Fractal Id: ${id.toString()}] Version error: ${x}`)
389
+ ...boundedContextIdErrors,
390
+ ...nameErrors,
391
+ ...versionErrors
368
392
  ];
369
393
  };
394
+ const addContextToErrors$6 = (value, errors) => {
395
+ return errors.map((error) => `[Fractal Id: ${toString$1(value)}]${error}`);
396
+ };
370
397
  /**
371
398
  * Represents the default identifier for a fractal instance.
372
399
  *
@@ -386,7 +413,9 @@ const isValidFractalId = (id) => {
386
413
  const DEFAULT_FRACTAL_ID = {
387
414
  boundedContextId: DEFAULT_BOUNDED_CONTEXT_ID,
388
415
  name: DEFAULT_KEBAB_CASE_STRING,
389
- version: DEFAULT_VERSION
416
+ version: DEFAULT_VERSION,
417
+ equals: () => false,
418
+ toString: () => ""
390
419
  };
391
420
  /**
392
421
  * Provides a builder for constructing a `FractalId` object.
@@ -429,7 +458,8 @@ const getFractalIdBuilder = () => {
429
458
  if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
430
459
  const builtId = {
431
460
  ...internalState,
432
- toString: () => toString(builtId)
461
+ equals: (other) => equals$2(builtId, other),
462
+ toString: () => toString$1(builtId)
433
463
  };
434
464
  return builtId;
435
465
  }
@@ -472,7 +502,7 @@ let ServiceDeliveryModel$1 = /* @__PURE__ */ function(ServiceDeliveryModel) {
472
502
  * if the string is valid.
473
503
  */
474
504
  const isValidPascalCaseString = (value) => {
475
- if (!/^[A-Z][a-zA-Z]*$/.test(value)) return [`Value '${value}' must be in PascalCase`];
505
+ if (!/^[A-Z][a-zA-Z0-9]*$/.test(value)) return [` Value '${value}' must be in PascalCase`];
476
506
  return [];
477
507
  };
478
508
  /**
@@ -481,7 +511,12 @@ const isValidPascalCaseString = (value) => {
481
511
  * This variable is declared as a constant to prevent modification
482
512
  * and is designed to not pass validation checks.
483
513
  */
484
- const DEFAULT_PASCAL_CASE_STRING = { pascalValue: "" };
514
+ const DEFAULT_PASCAL_CASE_STRING = {
515
+ _type: "pascal",
516
+ value: "",
517
+ equals: () => false,
518
+ toString: () => ""
519
+ };
485
520
  /**
486
521
  * Creates a builder for constructing a PascalCaseString object. The builder enforces Pascal case formatting and ensures
487
522
  * a valid string is set before building. Once built, the PascalCaseString object becomes immutable.
@@ -496,17 +531,21 @@ const getPascalCaseStringBuilder = () => {
496
531
  const internalState = { ...DEFAULT_PASCAL_CASE_STRING };
497
532
  const builder = {
498
533
  withValue: (value) => {
499
- internalState.pascalValue = value;
534
+ internalState.value = value;
500
535
  return builder;
501
536
  },
502
537
  reset: () => {
503
- internalState.pascalValue = DEFAULT_PASCAL_CASE_STRING.pascalValue;
538
+ internalState.value = DEFAULT_PASCAL_CASE_STRING.value;
504
539
  return builder;
505
540
  },
506
541
  build: () => {
507
- const validationErrors = isValidPascalCaseString(internalState.pascalValue);
542
+ const validationErrors = isValidPascalCaseString(internalState.value);
508
543
  if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
509
- return { ...internalState };
544
+ return {
545
+ ...internalState,
546
+ equals: (other) => internalState.value === other.value,
547
+ toString: () => internalState.value
548
+ };
510
549
  }
511
550
  };
512
551
  return builder;
@@ -566,8 +605,8 @@ const DEFAULT_COMPONENT_TYPE = {
566
605
  * @returns {string[]} An array of error messages if validation fails; an empty array if the name is valid.
567
606
  */
568
607
  const isValidComponentType = (type) => {
569
- const nameError = isValidPascalCaseString(type.name.pascalValue);
570
- if (nameError.length > 0) return nameError.map((x) => `[Component Type: ${type.name.pascalValue}] Name error: ${x}`);
608
+ const nameError = isValidPascalCaseString(type.name.value);
609
+ if (nameError.length > 0) return nameError.map((x) => `[Component Type: ${type.name.value}][Name]${x}`);
571
610
  return [];
572
611
  };
573
612
  /**
@@ -680,7 +719,10 @@ const getBlueprintComponentTypeBuilder = () => {
680
719
  build: () => {
681
720
  const validationErrors = isValidBlueprintComponentType(internalState);
682
721
  if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
683
- return { ...internalState };
722
+ return {
723
+ ...internalState,
724
+ toString: () => `${internalState.domain}.${internalState.serviceDeliveryModel}.${internalState.name}`
725
+ };
684
726
  }
685
727
  };
686
728
  return builder;
@@ -722,16 +764,17 @@ const getParametersInstance = () => {
722
764
  * @returns {boolean} - Returns true if the identifier is in a valid kebab-case format, false otherwise.
723
765
  */
724
766
  const isValidId = (id) => {
725
- return isValidKebabCaseString(id.value.kebabValue).map((x) => `[Component Id: ${id.value.kebabValue}] Id error: ${x}`);
767
+ return isValidKebabCaseString(id.value.toString()).map((x) => `[Component Id: ${id.value.toString()}]${x}`);
726
768
  };
727
- const equals = (a, b) => a.value === b.value;
769
+ const equals$1 = (a, b) => a.value === b.value;
728
770
  /**
729
771
  * Represents the default identifier used in the application.
730
772
  * It is initialized with a value that will not pass validation.
731
773
  */
732
774
  const DEFAULT_COMPONENT_ID = {
733
775
  value: DEFAULT_KEBAB_CASE_STRING,
734
- equals: (other) => equals(DEFAULT_COMPONENT_ID, other)
776
+ equals: (other) => equals$1(DEFAULT_COMPONENT_ID, other),
777
+ toString: () => ""
735
778
  };
736
779
  /**
737
780
  * Creates and returns a builder for constructing a `ComponentId` object.
@@ -759,7 +802,8 @@ const getComponentIdBuilder = () => {
759
802
  if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
760
803
  const builtId = {
761
804
  ...internalState,
762
- equals: (other) => equals(builtId, other)
805
+ equals: (other) => equals$1(builtId, other),
806
+ toString: () => builtId.value.toString()
763
807
  };
764
808
  return builtId;
765
809
  }
@@ -885,18 +929,21 @@ const DEFAULT_COMPONENT = {
885
929
  * @returns {string[]} An array of error messages, each describing a specific validation failure. If no errors are found, the array will be empty.
886
930
  */
887
931
  const isValidComponent = (component) => {
888
- const idErrors = isValidId(component.id);
889
- const typeErrors = isValidComponentType(component.type);
890
- const versionErrors = isValidVersion(component.version);
891
- const displayNameErrors = isNonEmptyString(component.displayName) ? [] : ["Display name must be a non-empty string"];
932
+ const idErrors = addContextToErrors$5(component.id, isValidId(component.id));
933
+ const typeErrors = addContextToErrors$5(component.id, isValidComponentType(component.type));
934
+ const versionErrors = addContextToErrors$5(component.id, isValidVersion(component.version));
935
+ const displayNameErrors = addContextToErrors$5(component.id, isNonEmptyString(component.displayName) ? [] : ["Display name must be a non-empty string"]);
892
936
  return [
893
- ...idErrors.map((x) => `[Component: ${component.id.value}] Id error: ${x}`),
894
- ...typeErrors.map((x) => `[Component: ${component.id.value}] Type error: ${x}`),
895
- ...versionErrors.map((x) => `[Component: ${component.id.value}] Version error: ${x}`),
896
- ...typeErrors.map((x) => `[Component: ${component.id.value}] Type error: ${x}`),
897
- ...displayNameErrors.map((x) => `[Component: ${component.id.value}] Display Name error: ${x}`)
937
+ ...idErrors,
938
+ ...typeErrors,
939
+ ...versionErrors,
940
+ ...typeErrors,
941
+ ...displayNameErrors
898
942
  ];
899
943
  };
944
+ const addContextToErrors$5 = (componentId, errors) => {
945
+ return errors.map((error) => `[Component: ${componentId.toString()}]${error}`);
946
+ };
900
947
  /**
901
948
  * Creates and returns a builder for constructing `Component` objects.
902
949
  *
@@ -1034,7 +1081,7 @@ const isValidBlueprintComponent = (component) => {
1034
1081
  * - `withVersion(version: Version)`: Sets the version of the component.
1035
1082
  * - `withDisplayName(displayName: string)`: Sets the display name for the component.
1036
1083
  * - `withDescription(description: string)`: Sets a description for the component.
1037
- * - `withParameters(parameters: GenericParameters)`: Sets the parameters associated with the component.
1084
+ * - `withParameters(parameters: Component.Parameters)`: Sets the parameters associated with the component.
1038
1085
  * - `withLinks(links: ComponentLink[])`: Sets the links associated with the component.
1039
1086
  * - `withDependencies(dependencies: BlueprintComponentDependency[])`: Sets the dependencies of the component.
1040
1087
  * - `reset()`: Resets all properties of the component to their default values based on `DEFAULT_BLUEPRINT_COMPONENT`.
@@ -1122,22 +1169,23 @@ let BlueprintComponent;
1122
1169
 
1123
1170
  //#endregion
1124
1171
  //#region src/fractal/service.ts
1125
- const CLIENT_ID_HEADER = "X-ClientID";
1126
- const CLIENT_SECRET_HEADER = "X-ClientSecret";
1127
- const FRACTAL_API_URL = "https://api.fractal.cloud";
1172
+ const CLIENT_ID_HEADER$1 = "X-ClientID";
1173
+ const CLIENT_SECRET_HEADER$1 = "X-ClientSecret";
1174
+ const FRACTAL_API_URL$1 = "https://api.fractal.cloud";
1128
1175
  const deployFractal = async (credentials, fractal) => {
1129
- await superagent.default.post(`${FRACTAL_API_URL}/blueprints/${fractal.id.toString().replace(":", "/")}`).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret).send({
1176
+ const fractalUrl = `${FRACTAL_API_URL$1}/blueprints/${fractal.id.toString().replace(":", "/")}`;
1177
+ ((await superagent.default.get(fractalUrl).ok((res) => res.status === 200 || res.status === 404).set(CLIENT_ID_HEADER$1, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER$1, credentials.secret).send()).status === 200 ? superagent.default.put(fractalUrl) : superagent.default.post(fractalUrl)).set(CLIENT_ID_HEADER$1, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER$1, credentials.secret).send({
1130
1178
  description: fractal.description,
1131
1179
  isPrivate: fractal.isPrivate,
1132
1180
  components: fractal.components.map((c) => ({
1133
1181
  ...c,
1134
1182
  type: c.type.toString(),
1135
- id: c.id.value.kebabValue,
1183
+ id: c.id.value.toString(),
1136
1184
  version: c.version.toString(),
1137
1185
  parameters: c.parameters.toMap(),
1138
- dependencies: c.dependencies.map((d) => d.id.value.kebabValue),
1186
+ dependencies: c.dependencies.map((d) => d.id.value.toString()),
1139
1187
  links: c.links.map((l) => ({
1140
- componentId: l.id.value.kebabValue,
1188
+ componentId: l.id.value.toString(),
1141
1189
  settings: l.parameters.toMap()
1142
1190
  })),
1143
1191
  outputFields: Object.keys(c.outputFields.value)
@@ -1145,7 +1193,7 @@ const deployFractal = async (credentials, fractal) => {
1145
1193
  }).catch((e) => console.error(e.message, e.response.text));
1146
1194
  };
1147
1195
  const destroyFractal = async (credentials, id) => {
1148
- await superagent.default.delete(`${FRACTAL_API_URL}/blueprints/${id.toString().replace(":", "/")}`).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret);
1196
+ await superagent.default.delete(`${FRACTAL_API_URL$1}/blueprints/${id.toString().replace(":", "/")}`).set(CLIENT_ID_HEADER$1, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER$1, credentials.secret);
1149
1197
  };
1150
1198
  let FractalService;
1151
1199
  (function(_FractalService) {
@@ -1192,13 +1240,37 @@ const DEFAULT_FRACTAL = {
1192
1240
  * @returns {string[]} An array of error messages describing any validation issues with the fractal.
1193
1241
  */
1194
1242
  const isValidFractal = (fractal) => {
1195
- const idErrors = isValidFractalId(fractal.id);
1196
- const componentsErrors = !fractal.components || fractal.components.length === 0 ? [`[Fractal: ${fractal.id.toString()}]: components must not be empty`] : fractal.components.reduce((acc, x) => {
1197
- acc.push(...isValidBlueprintComponent(x));
1243
+ const idErrors = addContextToErrors$4(fractal.id, isValidFractalId(fractal.id));
1244
+ const componentsErrors = addContextToErrors$4(fractal.id, !fractal.components || fractal.components.length === 0 ? ["[Components] Components must not be empty"] : fractal.components.reduce((acc, x) => {
1245
+ if ("provider" in x) acc.push(`[Component: ${x.id.toString()}] Live system components cannot be added to a Fractal blueprint. Use LiveSystem.withComponent() instead.`);
1246
+ else acc.push(...isValidBlueprintComponent(x));
1198
1247
  return acc;
1199
- }, []);
1248
+ }, []));
1200
1249
  return [...idErrors, ...componentsErrors];
1201
1250
  };
1251
+ const addContextToErrors$4 = (value, errors) => {
1252
+ return errors.map((error) => `[Fractal: ${value.toString()}]${error}`);
1253
+ };
1254
+ /**
1255
+ * Creates and returns a builder object for constructing Fractal objects.
1256
+ *
1257
+ * This builder provides a fluent interface for setting various properties of a Fractal
1258
+ * and includes methods for validation, resetting to defaults, and final construction.
1259
+ *
1260
+ * @returns {FractalBuilder} A builder object for incrementally building a Fractal.
1261
+ *
1262
+ * The builder object supports the following methods:
1263
+ * - `withId(value: FractalId): FractalBuilder` - Sets the ID of the Fractal.
1264
+ * - `withIsPrivate(value: boolean): FractalBuilder` - Sets the privacy status of the Fractal.
1265
+ * - `withDescription(value: string): FractalBuilder` - Sets the description of the Fractal.
1266
+ * - `withComponents(value: BlueprintComponent[]): FractalBuilder` - Appends a list of components to the Fractal.
1267
+ * - `withComponent(value: BlueprintComponent): FractalBuilder` - Appends a single component to the Fractal.
1268
+ * - `reset(): FractalBuilder` - Resets the builder’s state to the default Fractal properties.
1269
+ * - `build(): Fractal` - Validates and constructs a Fractal object.
1270
+ *
1271
+ * Throws:
1272
+ * - `SyntaxError` - If the constructed Fractal object is invalid during the build process.
1273
+ */
1202
1274
  const getFractalBuilder = () => {
1203
1275
  const internalState = { ...DEFAULT_FRACTAL };
1204
1276
  const builder = {
@@ -1284,9 +1356,12 @@ const DEFAULT = {
1284
1356
  * @returns {boolean} Returns true if the bounded context is valid; otherwise, returns false.
1285
1357
  */
1286
1358
  const isValidBoundedContext = (value) => {
1287
- const idErrors = isValidBoundedContextId(value.id);
1288
- const displayNameErrors = isNonEmptyString(value.displayName) ? [] : ["Display name must be a non-empty string"];
1289
- return [...idErrors.map((x) => `[Bounded Context: ${value.id.toString()}] Id error: ${x}`), ...displayNameErrors.map((x) => `[Bounded Context: ${value.id.toString()}] Display Name error: ${x}`)];
1359
+ const idErrors = addContextToErrors$3(value.id, isValidBoundedContextId(value.id));
1360
+ const displayNameErrors = addContextToErrors$3(value.id, isNonEmptyString(value.displayName) ? [] : ["Display name must be a non-empty string"]);
1361
+ return [...idErrors, ...displayNameErrors];
1362
+ };
1363
+ const addContextToErrors$3 = (bcId, errors) => {
1364
+ return errors.map((error) => `[Bounded Context: ${bcId.toString()}]${error}`);
1290
1365
  };
1291
1366
  /**
1292
1367
  * Creates a builder for constructing a BoundedContext object with a fluid API.
@@ -1465,6 +1540,3014 @@ let ServiceAccountCredentials$1;
1465
1540
  _ServiceAccountCredentials.getBuilder = getServiceAccountCredentialsBuilder;
1466
1541
  })(ServiceAccountCredentials$1 || (ServiceAccountCredentials$1 = {}));
1467
1542
 
1543
+ //#endregion
1544
+ //#region src/environment/id.ts
1545
+ const equals = (a, b) => a.ownerType === b.ownerType && a.ownerId.value === b.ownerId.value && a.name.value === b.name.value;
1546
+ /**
1547
+ * Represents the default environment identifier used within the system.
1548
+ * The variable holds a constant, immutable object reflecting the default
1549
+ * properties and metadata of an environment.
1550
+ *
1551
+ * Properties:
1552
+ * - `ownerType`: An enumeration value specifying the type of owner (e.g., personal).
1553
+ * - `ownerId`: A constant value representing the default owner identifier.
1554
+ * - `name`: A default kebab-case formatted string for the environment name.
1555
+ * - `equals`: A function that always returns `false`, used to compare equality with another environment.
1556
+ * - `toString`: A function returning an empty string representation of the environment.
1557
+ *
1558
+ * The object is defined as `const` to ensure its immutability and integrity throughout its usage.
1559
+ */
1560
+ const DEFAULT_ENVIRONMENT_ID = {
1561
+ _type: "environment",
1562
+ ownerType: OwnerType$1.Personal,
1563
+ ownerId: DEFAULT_OWNER_ID,
1564
+ name: DEFAULT_KEBAB_CASE_STRING,
1565
+ equals: () => false,
1566
+ toString: () => ""
1567
+ };
1568
+ /**
1569
+ * Validates whether the given environment ID is valid by checking its owner ID and name.
1570
+ *
1571
+ * @param {EnvironmentId} value - The environment ID to validate, which consists of an owner ID and a name.
1572
+ * @returns {string[]} An array of error messages, where each message describes a specific validation failure
1573
+ * for either the owner ID or the name. If no errors are present, the array is empty.
1574
+ */
1575
+ const isValidEnvironmentId = (value) => {
1576
+ const ownerIdErrors = addContextToErrors$2(value, isValidOwnerId(value.ownerId));
1577
+ const nameErrors = addContextToErrors$2(value, isValidKebabCaseString(value.name.toString()));
1578
+ return [...ownerIdErrors, ...nameErrors];
1579
+ };
1580
+ const addContextToErrors$2 = (value, errors) => {
1581
+ return errors.map((error) => `[Environment Id: ${environmentIdToString(value)}]${error}`);
1582
+ };
1583
+ const environmentIdToString = (id) => `${id.ownerType.toString()}/${id.ownerId.value}/${id.name.value}`;
1584
+ /**
1585
+ * Creates and returns a builder for constructing a `Id` object.
1586
+ *
1587
+ * The builder allows customization of the `Id` properties such as `ownerType`,
1588
+ * while also enforcing constraints during the construction process, ensuring the resulting object is valid.
1589
+ * The builder is stateful and provides a method to reset to default values if needed.
1590
+ *
1591
+ * @returns {EnvironmentIdBuilder} A builder object that provides methods for modifying and constructing a `Id`.
1592
+ *
1593
+ * @throws {SyntaxError} Throws an error if the resulting `Id` is invalid when the `build` method is invoked.
1594
+ */
1595
+ const getEnvironmentIdBuilder = () => {
1596
+ const internalState = { ...DEFAULT_ENVIRONMENT_ID };
1597
+ const builder = {
1598
+ withOwnerType: (ownerType) => {
1599
+ internalState.ownerType = ownerType;
1600
+ return builder;
1601
+ },
1602
+ withOwnerId: (ownerId) => {
1603
+ internalState.ownerId = ownerId;
1604
+ return builder;
1605
+ },
1606
+ withName: (name) => {
1607
+ internalState.name = name;
1608
+ return builder;
1609
+ },
1610
+ reset: () => {
1611
+ internalState.ownerType = DEFAULT_ENVIRONMENT_ID.ownerType;
1612
+ internalState.ownerId = DEFAULT_ENVIRONMENT_ID.ownerId;
1613
+ internalState.name = DEFAULT_ENVIRONMENT_ID.name;
1614
+ return builder;
1615
+ },
1616
+ build: () => {
1617
+ const validationErrors = isValidEnvironmentId(internalState);
1618
+ if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
1619
+ const builtId = {
1620
+ ...internalState,
1621
+ equals: (other) => equals(builtId, other),
1622
+ toString: () => environmentIdToString(builtId)
1623
+ };
1624
+ return builtId;
1625
+ }
1626
+ };
1627
+ return builder;
1628
+ };
1629
+
1630
+ //#endregion
1631
+ //#region src/environment/entity.ts
1632
+ const DEFAULT_ENVIRONMENT = {
1633
+ id: DEFAULT_ENVIRONMENT_ID,
1634
+ parameters: getParametersInstance()
1635
+ };
1636
+ const isValidEnvironment = (environment) => addContextToErrors$1(environment.id, isValidEnvironmentId(environment.id));
1637
+ const addContextToErrors$1 = (environmentId, errors) => {
1638
+ return errors.map((error) => `[Environment: ${environmentId.toString()}]${error}`);
1639
+ };
1640
+ const getEnvironmentBuilder = () => {
1641
+ const internalState = { ...DEFAULT_ENVIRONMENT };
1642
+ const builder = {
1643
+ withId: (id) => {
1644
+ internalState.id = id;
1645
+ return builder;
1646
+ },
1647
+ withParameters: (parameters) => {
1648
+ internalState.parameters = parameters;
1649
+ return builder;
1650
+ },
1651
+ reset: () => {
1652
+ internalState.id = DEFAULT_ENVIRONMENT.id;
1653
+ internalState.parameters = DEFAULT_ENVIRONMENT.parameters;
1654
+ return builder;
1655
+ },
1656
+ build: () => {
1657
+ const validationErrors = isValidEnvironment(internalState);
1658
+ if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
1659
+ return { ...internalState };
1660
+ }
1661
+ };
1662
+ return builder;
1663
+ };
1664
+
1665
+ //#endregion
1666
+ //#region src/environment/index.ts
1667
+ let Environment$1;
1668
+ (function(_Environment) {
1669
+ let Id;
1670
+ (function(_Id) {
1671
+ _Id.getBuilder = getEnvironmentIdBuilder;
1672
+ })(Id || (Id = _Environment.Id || (_Environment.Id = {})));
1673
+ _Environment.getBuilder = getEnvironmentBuilder;
1674
+ })(Environment$1 || (Environment$1 = {}));
1675
+
1676
+ //#endregion
1677
+ //#region src/live_system/id.ts
1678
+ const toString = (id) => `${id.boundedContextId.toString()}/${id.name.value}`;
1679
+ /**
1680
+ * Validates the specified LiveSystemId and returns a list of error messages.
1681
+ *
1682
+ * The validation process includes checking the validity of the bounded context ID
1683
+ * and the name associated with the LiveSystemId.
1684
+ *
1685
+ * @param {LiveSystemId} id - The LiveSystemId object to be validated. It contains
1686
+ * a bounded context ID and a name in kebab-case format.
1687
+ * @returns {string[]} An array of error messages generated during validation. Each error message
1688
+ * is prepended with the string representation of the provided LiveSystemId for context.
1689
+ */
1690
+ const isValidLiveSystemId = (id) => {
1691
+ const boundedContextIdErrors = isValidBoundedContextId(id.boundedContextId);
1692
+ const nameErrors = isValidKebabCaseString(id.name.value);
1693
+ return [...boundedContextIdErrors.map((x) => `[Live System Id: ${id.toString()}] Bounded Context Id error: ${x}`), ...nameErrors.map((x) => `[Live System Id: ${id.toString()}] Name errors: ${x}`)];
1694
+ };
1695
+ /**
1696
+ * Represents the default identifier for a live system within a bounded context.
1697
+ *
1698
+ * This constant is used to define the default configuration for a live system by associating a
1699
+ * predefined bounded context identifier with a default name in kebab-case format.
1700
+ *
1701
+ * Fields:
1702
+ * - `boundedContextId`: Identifies the default bounded context to which the live system belongs.
1703
+ * - `name`: Specifies the default name of the live system in a standardized kebab-case string format.
1704
+ */
1705
+ const DEFAULT_LIVE_SYSTEM_ID = {
1706
+ boundedContextId: DEFAULT_BOUNDED_CONTEXT_ID,
1707
+ name: DEFAULT_KEBAB_CASE_STRING
1708
+ };
1709
+ /**
1710
+ * Creates and returns a `LiveSystemIdBuilder` to construct and validate `LiveSystemId` objects.
1711
+ *
1712
+ * The builder provides a fluent API for setting properties and validating the resulting `LiveSystemId`.
1713
+ *
1714
+ * @returns {LiveSystemIdBuilder} A builder object with methods to configure, reset, and build a `LiveSystemId`.
1715
+ *
1716
+ * Methods available in the builder:
1717
+ * - `withBoundedContextId(value: BoundedContext.Id)`: Sets the bounded context ID for the `LiveSystemId`.
1718
+ * - `withName(value: KebabCaseString)`: Sets the name for the `LiveSystemId`.
1719
+ * - `reset()`: Resets all properties to their default values as defined in `DEFAULT_LIVE_SYSTEM_ID`.
1720
+ * - `build()`: Validates the current state of the builder and constructs a `LiveSystemId` object. Throws a `SyntaxError` if validation fails.
1721
+ */
1722
+ const getLiveSystemIdBuilder = () => {
1723
+ const internalState = { ...DEFAULT_LIVE_SYSTEM_ID };
1724
+ const builder = {
1725
+ withBoundedContextId: (value) => {
1726
+ internalState.boundedContextId = value;
1727
+ return builder;
1728
+ },
1729
+ withName: (value) => {
1730
+ internalState.name = value;
1731
+ return builder;
1732
+ },
1733
+ reset: () => {
1734
+ internalState.boundedContextId = DEFAULT_LIVE_SYSTEM_ID.boundedContextId;
1735
+ internalState.name = DEFAULT_LIVE_SYSTEM_ID.name;
1736
+ return builder;
1737
+ },
1738
+ build: () => {
1739
+ const validationErrors = isValidLiveSystemId(internalState);
1740
+ if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
1741
+ const builtId = {
1742
+ ...internalState,
1743
+ toString: () => toString(builtId)
1744
+ };
1745
+ return builtId;
1746
+ }
1747
+ };
1748
+ return builder;
1749
+ };
1750
+
1751
+ //#endregion
1752
+ //#region src/live_system/component/entity.ts
1753
+ const DEFAULT_LIVE_SYSTEM_COMPONENT = {
1754
+ ...DEFAULT_BLUEPRINT_COMPONENT,
1755
+ status: "Instantiating",
1756
+ lastUpdated: /* @__PURE__ */ new Date(0),
1757
+ lastOperationRetried: -1,
1758
+ provider: "Unknown",
1759
+ lastOperationStatusMessage: "",
1760
+ errorCode: ""
1761
+ };
1762
+ const isValidLiveSystemComponent = (component) => isValidBlueprintComponent(component);
1763
+ const getLiveSystemComponentBuilder = () => {
1764
+ const internalState = { ...DEFAULT_LIVE_SYSTEM_COMPONENT };
1765
+ const builder = {
1766
+ withType: (type) => {
1767
+ internalState.type = type;
1768
+ return builder;
1769
+ },
1770
+ withId: (id) => {
1771
+ internalState.id = id;
1772
+ return builder;
1773
+ },
1774
+ withVersion: (version) => {
1775
+ internalState.version = version;
1776
+ return builder;
1777
+ },
1778
+ withIsLocked: (value) => {
1779
+ internalState.isLocked = value;
1780
+ return builder;
1781
+ },
1782
+ withRecreateOnFailure: (value) => {
1783
+ internalState.recreateOnFailure = value;
1784
+ return builder;
1785
+ },
1786
+ withProvider: (value) => {
1787
+ internalState.provider = value;
1788
+ return builder;
1789
+ },
1790
+ withDisplayName: (displayName) => {
1791
+ internalState.displayName = displayName;
1792
+ return builder;
1793
+ },
1794
+ withDescription: (description) => {
1795
+ internalState.description = description;
1796
+ return builder;
1797
+ },
1798
+ withParameters: (parameters) => {
1799
+ internalState.parameters = parameters;
1800
+ return builder;
1801
+ },
1802
+ withLinks: (links) => {
1803
+ internalState.links = links;
1804
+ return builder;
1805
+ },
1806
+ withDependencies: (dependencies) => {
1807
+ internalState.dependencies = dependencies;
1808
+ return builder;
1809
+ },
1810
+ reset: () => {
1811
+ internalState.type = DEFAULT_LIVE_SYSTEM_COMPONENT.type;
1812
+ internalState.id = DEFAULT_LIVE_SYSTEM_COMPONENT.id;
1813
+ internalState.version = DEFAULT_LIVE_SYSTEM_COMPONENT.version;
1814
+ internalState.displayName = DEFAULT_LIVE_SYSTEM_COMPONENT.displayName;
1815
+ internalState.description = DEFAULT_LIVE_SYSTEM_COMPONENT.description;
1816
+ internalState.parameters = DEFAULT_LIVE_SYSTEM_COMPONENT.parameters;
1817
+ internalState.links = DEFAULT_LIVE_SYSTEM_COMPONENT.links;
1818
+ internalState.dependencies = DEFAULT_LIVE_SYSTEM_COMPONENT.dependencies;
1819
+ internalState.isLocked = DEFAULT_LIVE_SYSTEM_COMPONENT.isLocked;
1820
+ internalState.provider = DEFAULT_LIVE_SYSTEM_COMPONENT.provider;
1821
+ internalState.recreateOnFailure = DEFAULT_LIVE_SYSTEM_COMPONENT.recreateOnFailure;
1822
+ return builder;
1823
+ },
1824
+ build: () => {
1825
+ const validationErrors = isValidLiveSystemComponent(internalState);
1826
+ if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
1827
+ return { ...internalState };
1828
+ }
1829
+ };
1830
+ return builder;
1831
+ };
1832
+
1833
+ //#endregion
1834
+ //#region src/live_system/service.ts
1835
+ const CLIENT_ID_HEADER = "X-ClientID";
1836
+ const CLIENT_SECRET_HEADER = "X-ClientSecret";
1837
+ const FRACTAL_API_URL = "https://api.fractal.cloud";
1838
+ const deployLiveSystem = async (credentials, liveSystem) => {
1839
+ const body = {
1840
+ liveSystemId: liveSystem.id.toString(),
1841
+ fractalId: liveSystem.fractalId.toString(),
1842
+ description: liveSystem.description,
1843
+ provider: liveSystem.genericProvider,
1844
+ blueprintMap: liveSystem.components.reduce((acc, c) => {
1845
+ acc[c.id.value.toString()] = {
1846
+ ...c,
1847
+ type: c.type.toString(),
1848
+ id: c.id.value.toString(),
1849
+ version: c.version.toString(),
1850
+ parameters: c.parameters.toMap(),
1851
+ dependencies: c.dependencies.map((d) => d.id.value.toString()),
1852
+ links: c.links.map((l) => ({
1853
+ componentId: l.id.value.toString(),
1854
+ settings: l.parameters.toMap()
1855
+ })),
1856
+ outputFields: c.outputFields.value
1857
+ };
1858
+ return acc;
1859
+ }, {}),
1860
+ parameters: liveSystem.parameters.toMap(),
1861
+ environment: {
1862
+ id: {
1863
+ type: liveSystem.environment.id.ownerType,
1864
+ ownerId: liveSystem.environment.id.ownerId.toString(),
1865
+ shortName: liveSystem.environment.id.name.toString()
1866
+ },
1867
+ parameters: liveSystem.environment.parameters.toMap()
1868
+ }
1869
+ };
1870
+ const liveSystemUrl = `${FRACTAL_API_URL}/livesystems/${liveSystem.id.toString()}`;
1871
+ ((await superagent.default.get(liveSystemUrl).ok((res) => res.status === 200 || res.status === 404).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret).send()).status === 200 ? superagent.default.put(liveSystemUrl) : superagent.default.post(`${FRACTAL_API_URL}/livesystems`)).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret).send(body).catch((e) => console.error(e.message, e.response.text));
1872
+ };
1873
+ const destroyLiveSystem = async (credentials, id) => {
1874
+ await superagent.default.delete(`${FRACTAL_API_URL}/livesystems/${id.toString()}`).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret);
1875
+ };
1876
+ let LiveSystemService;
1877
+ (function(_LiveSystemService) {
1878
+ _LiveSystemService.deploy = deployLiveSystem;
1879
+ _LiveSystemService.destroy = destroyLiveSystem;
1880
+ })(LiveSystemService || (LiveSystemService = {}));
1881
+
1882
+ //#endregion
1883
+ //#region src/live_system/entity.ts
1884
+ const DEFAULT_LIVE_SYSTEM = {
1885
+ id: DEFAULT_LIVE_SYSTEM_ID,
1886
+ requesterId: "",
1887
+ fractalId: DEFAULT_FRACTAL_ID,
1888
+ description: "",
1889
+ status: "Unknown",
1890
+ statusMessage: "",
1891
+ components: [],
1892
+ genericProvider: "Unknown",
1893
+ parameters: getParametersInstance(),
1894
+ createdAt: /* @__PURE__ */ new Date(),
1895
+ updatedAt: /* @__PURE__ */ new Date(),
1896
+ environment: DEFAULT_ENVIRONMENT,
1897
+ deploy: () => Promise.reject(),
1898
+ destroy: () => Promise.reject()
1899
+ };
1900
+ /**
1901
+ * Validates a given live system and returns a list of error messages if any validation fails.
1902
+ *
1903
+ * This function verifies the following:
1904
+ * - The `id` of the live system is valid.
1905
+ * - The `fractalId` of the live system is valid.
1906
+ * - The `components` field is not empty and all its components pass validation.
1907
+ *
1908
+ * @param {LiveSystem} liveSystem - The live system object to be validated.
1909
+ * @returns {string[]} An array of error messages. If validation passes, this array will be empty.
1910
+ */
1911
+ const isValidLiveSystem = (liveSystem) => {
1912
+ const idErrors = addContextToErrors(liveSystem.id, isValidLiveSystemId(liveSystem.id));
1913
+ const fractalIdErrors = addContextToErrors(liveSystem.id, isValidFractalId(liveSystem.fractalId));
1914
+ const environmentErrors = addContextToErrors(liveSystem.id, isValidEnvironment(liveSystem.environment));
1915
+ const componentsErrors = addContextToErrors(liveSystem.id, !liveSystem.components || liveSystem.components.length === 0 ? ["[Components] Components must not be empty"] : liveSystem.components.reduce((acc, x) => {
1916
+ acc.push(...isValidLiveSystemComponent(x));
1917
+ return acc;
1918
+ }, []));
1919
+ return [
1920
+ ...idErrors,
1921
+ ...fractalIdErrors,
1922
+ ...componentsErrors,
1923
+ ...environmentErrors
1924
+ ];
1925
+ };
1926
+ const addContextToErrors = (liveSystemId, errors) => {
1927
+ return errors.map((error) => `[Live System: ${liveSystemId.toString()}]${error}`);
1928
+ };
1929
+ /**
1930
+ * Creates and returns a builder for constructing LiveSystem objects.
1931
+ * The builder allows the user to configure various properties of a LiveSystem
1932
+ * instance through a fluent API.
1933
+ *
1934
+ * @returns {LiveSystemBuilder} An object providing methods to configure and build a LiveSystem instance.
1935
+ *
1936
+ * @description
1937
+ * The `getLiveSystemBuilder` function initializes a builder object for constructing LiveSystem instances.
1938
+ * The builder maintains an internal state that gets updated through its methods. When the `build` method
1939
+ * is invoked, the internal state is validated and returned as a fully formed LiveSystem object.
1940
+ *
1941
+ * The builder provides the following configuration methods:
1942
+ * - `withId(value: LiveSystemId)`: Sets the `id` property of the LiveSystem.
1943
+ * - `withDescription(value: string)`: Sets the `description` property of the LiveSystem.
1944
+ * - `withFractalId(value: Fractal.Id)`: Sets the `fractalId` property of the LiveSystem.
1945
+ * - `withComponents(value: LiveSystemComponent[])`: Adds an array of components to the LiveSystem.
1946
+ * - `withComponent(value: LiveSystemComponent)`: Adds a single component to the LiveSystem.
1947
+ * - `withGenericProvider(value: LiveSystemComponent.Provider)`: Sets the `genericProvider` property of the LiveSystem.
1948
+ * - `withParameters(parameters: ComponentParameters): Assigns the provided `parameters` to the `LiveSystem`.
1949
+ *
1950
+ * Additional builder methods:
1951
+ * - `reset()`: Resets the internal state to the default LiveSystem configuration.
1952
+ * - `build()`: Validates the internal state and returns a LiveSystem instance. If validation fails, an error is thrown.
1953
+ *
1954
+ * Validation:
1955
+ * The `build` method performs validation on the internal state using the `isValidLiveSystem` function. If validation
1956
+ * errors are detected, a `SyntaxError` is thrown containing the list of errors.
1957
+ *
1958
+ * Lifecycle Operations:
1959
+ * The constructed LiveSystem object includes the `deploy` and `destroy` methods:
1960
+ * - `deploy(credentials)`: Deploys the LiveSystem using the given credentials.
1961
+ * - `destroy(credentials)`: Destroys the LiveSystem using the given credentials and its `id`.
1962
+ */
1963
+ const getLiveSystemBuilder = () => {
1964
+ const internalState = { ...DEFAULT_LIVE_SYSTEM };
1965
+ const builder = {
1966
+ withId: (value) => {
1967
+ internalState.id = value;
1968
+ return builder;
1969
+ },
1970
+ withFractalId: (value) => {
1971
+ internalState.fractalId = value;
1972
+ return builder;
1973
+ },
1974
+ withDescription: (value) => {
1975
+ internalState.description = value;
1976
+ return builder;
1977
+ },
1978
+ withComponents: (value) => {
1979
+ if (!internalState.components) internalState.components = [];
1980
+ internalState.components.push(...value);
1981
+ return builder;
1982
+ },
1983
+ withComponent: (value) => {
1984
+ if (!internalState.components) internalState.components = [];
1985
+ internalState.components.push(value);
1986
+ return builder;
1987
+ },
1988
+ withGenericProvider: (value) => {
1989
+ internalState.genericProvider = value;
1990
+ return builder;
1991
+ },
1992
+ withParameters: (parameters) => {
1993
+ internalState.parameters = parameters;
1994
+ return builder;
1995
+ },
1996
+ withEnvironment: (environment) => {
1997
+ internalState.environment = environment;
1998
+ return builder;
1999
+ },
2000
+ reset: () => {
2001
+ internalState.id = DEFAULT_LIVE_SYSTEM.id;
2002
+ internalState.requesterId = DEFAULT_LIVE_SYSTEM.requesterId;
2003
+ internalState.fractalId = DEFAULT_LIVE_SYSTEM.fractalId;
2004
+ internalState.description = DEFAULT_LIVE_SYSTEM.description;
2005
+ internalState.status = DEFAULT_LIVE_SYSTEM.status;
2006
+ internalState.statusMessage = DEFAULT_LIVE_SYSTEM.statusMessage;
2007
+ internalState.components = DEFAULT_LIVE_SYSTEM.components;
2008
+ internalState.genericProvider = DEFAULT_LIVE_SYSTEM.genericProvider;
2009
+ internalState.environment = DEFAULT_LIVE_SYSTEM.environment;
2010
+ internalState.createdAt = DEFAULT_LIVE_SYSTEM.createdAt;
2011
+ internalState.updatedAt = DEFAULT_LIVE_SYSTEM.updatedAt;
2012
+ return builder;
2013
+ },
2014
+ build: () => {
2015
+ const validationErrors = isValidLiveSystem(internalState);
2016
+ if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
2017
+ return {
2018
+ ...internalState,
2019
+ deploy: (credentials) => LiveSystemService.deploy(credentials, internalState),
2020
+ destroy: (credentials) => LiveSystemService.destroy(credentials, internalState.id)
2021
+ };
2022
+ }
2023
+ };
2024
+ return builder;
2025
+ };
2026
+
2027
+ //#endregion
2028
+ //#region src/live_system/index.ts
2029
+ let LiveSystem$1;
2030
+ (function(_LiveSystem) {
2031
+ let Id;
2032
+ (function(_Id) {
2033
+ _Id.getBuilder = getLiveSystemIdBuilder;
2034
+ })(Id || (Id = _LiveSystem.Id || (_LiveSystem.Id = {})));
2035
+ let Component;
2036
+ (function(_Component) {
2037
+ _Component.getBuilder = getLiveSystemComponentBuilder;
2038
+ })(Component || (Component = _LiveSystem.Component || (_LiveSystem.Component = {})));
2039
+ _LiveSystem.getBuilder = getLiveSystemBuilder;
2040
+ })(LiveSystem$1 || (LiveSystem$1 = {}));
2041
+
2042
+ //#endregion
2043
+ //#region src/fractal/component/network_and_compute/iaas/virtual_network.ts
2044
+ const VIRTUAL_NETWORK_TYPE_NAME = "VirtualNetwork";
2045
+ const CIDR_BLOCK_PARAM$1 = "cidrBlock";
2046
+ function buildId$28(id) {
2047
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2048
+ }
2049
+ function buildVersion$28(major, minor, patch) {
2050
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2051
+ }
2052
+ function buildVirtualNetworkType() {
2053
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(VIRTUAL_NETWORK_TYPE_NAME).build()).build();
2054
+ }
2055
+ function pushParam$25(params, key, value) {
2056
+ params.push(key, value);
2057
+ }
2058
+ function makeVirtualNetworkNode(vpc, subnetNodes, sgs) {
2059
+ const vpcDep = { id: vpc.id };
2060
+ const wiredSubnets = subnetNodes.map((n) => ({
2061
+ ...n.subnet,
2062
+ dependencies: [...n.subnet.dependencies, vpcDep]
2063
+ }));
2064
+ const wiredSgs = sgs.map((sg) => ({
2065
+ ...sg,
2066
+ dependencies: [vpcDep]
2067
+ }));
2068
+ const allVMs = subnetNodes.flatMap((n) => n.virtualMachines);
2069
+ const allEcsSvcs = subnetNodes.flatMap((n) => n.workloads);
2070
+ return {
2071
+ vpc,
2072
+ subnets: wiredSubnets,
2073
+ securityGroups: wiredSgs,
2074
+ virtualMachines: allVMs,
2075
+ workloads: allEcsSvcs,
2076
+ components: [
2077
+ vpc,
2078
+ ...wiredSubnets,
2079
+ ...wiredSgs,
2080
+ ...allVMs,
2081
+ ...allEcsSvcs
2082
+ ],
2083
+ withSubnets: (newSubnets) => makeVirtualNetworkNode(vpc, newSubnets, sgs),
2084
+ withSecurityGroups: (newSgs) => makeVirtualNetworkNode(vpc, subnetNodes, newSgs)
2085
+ };
2086
+ }
2087
+ let VirtualNetwork;
2088
+ (function(_VirtualNetwork) {
2089
+ const getBuilder = _VirtualNetwork.getBuilder = () => {
2090
+ const params = getParametersInstance();
2091
+ const inner = getBlueprintComponentBuilder().withType(buildVirtualNetworkType()).withParameters(params);
2092
+ const subnetBuilders = [];
2093
+ const sgBuilders = [];
2094
+ const builder = {
2095
+ withId: (id) => {
2096
+ inner.withId(buildId$28(id));
2097
+ return builder;
2098
+ },
2099
+ withVersion: (major, minor, patch) => {
2100
+ inner.withVersion(buildVersion$28(major, minor, patch));
2101
+ return builder;
2102
+ },
2103
+ withDisplayName: (displayName) => {
2104
+ inner.withDisplayName(displayName);
2105
+ return builder;
2106
+ },
2107
+ withDescription: (description) => {
2108
+ inner.withDescription(description);
2109
+ return builder;
2110
+ },
2111
+ withCidrBlock: (value) => {
2112
+ pushParam$25(params, CIDR_BLOCK_PARAM$1, value);
2113
+ return builder;
2114
+ },
2115
+ withSubnet: (subnetBuilder) => {
2116
+ subnetBuilders.push(subnetBuilder);
2117
+ return builder;
2118
+ },
2119
+ withSecurityGroup: (sgBuilder) => {
2120
+ sgBuilders.push(sgBuilder);
2121
+ return builder;
2122
+ },
2123
+ withLinks: (links) => {
2124
+ inner.withLinks(links);
2125
+ return builder;
2126
+ },
2127
+ build: () => {
2128
+ const vpc = inner.build();
2129
+ const vpcDep = { id: vpc.id };
2130
+ const subnetResults = subnetBuilders.map((b) => b.build());
2131
+ const subnets = subnetResults.map((r) => ({
2132
+ ...r.subnet,
2133
+ dependencies: [...r.subnet.dependencies, vpcDep]
2134
+ }));
2135
+ const virtualMachines = subnetResults.flatMap((r) => r.virtualMachines);
2136
+ const securityGroups = sgBuilders.map((b) => ({
2137
+ ...b.build(),
2138
+ dependencies: [vpcDep]
2139
+ }));
2140
+ return {
2141
+ vpc,
2142
+ subnets,
2143
+ securityGroups,
2144
+ virtualMachines,
2145
+ components: [
2146
+ vpc,
2147
+ ...subnets,
2148
+ ...securityGroups,
2149
+ ...virtualMachines
2150
+ ]
2151
+ };
2152
+ }
2153
+ };
2154
+ return builder;
2155
+ };
2156
+ _VirtualNetwork.create = (config) => {
2157
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
2158
+ if (config.cidrBlock) b.withCidrBlock(config.cidrBlock);
2159
+ if (config.description) b.withDescription(config.description);
2160
+ return makeVirtualNetworkNode(b.build().vpc, [], []);
2161
+ };
2162
+ })(VirtualNetwork || (VirtualNetwork = {}));
2163
+
2164
+ //#endregion
2165
+ //#region src/fractal/component/network_and_compute/iaas/subnet.ts
2166
+ const SUBNET_TYPE_NAME = "Subnet";
2167
+ const CIDR_BLOCK_PARAM = "cidrBlock";
2168
+ function buildId$27(id) {
2169
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2170
+ }
2171
+ function buildVersion$27(major, minor, patch) {
2172
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2173
+ }
2174
+ function buildSubnetType() {
2175
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(SUBNET_TYPE_NAME).build()).build();
2176
+ }
2177
+ function pushParam$24(params, key, value) {
2178
+ params.push(key, value);
2179
+ }
2180
+ function makeSubnetNode(subnet, vms, workloadNodes) {
2181
+ const subnetDep = { id: subnet.id };
2182
+ const wiredVMs = vms.map((n) => ({
2183
+ ...n.component,
2184
+ dependencies: [...n.component.dependencies, subnetDep]
2185
+ }));
2186
+ const wiredWorkloads = workloadNodes.map((w) => ({
2187
+ ...w.component,
2188
+ dependencies: [...w.component.dependencies, subnetDep]
2189
+ }));
2190
+ return {
2191
+ subnet,
2192
+ virtualMachines: wiredVMs,
2193
+ workloads: wiredWorkloads,
2194
+ components: [
2195
+ subnet,
2196
+ ...wiredVMs,
2197
+ ...wiredWorkloads
2198
+ ],
2199
+ withVirtualMachines: (newVMs) => makeSubnetNode(subnet, newVMs, workloadNodes),
2200
+ withWorkloads: (newWorkloads) => makeSubnetNode(subnet, vms, newWorkloads)
2201
+ };
2202
+ }
2203
+ let Subnet;
2204
+ (function(_Subnet) {
2205
+ const getBuilder = _Subnet.getBuilder = () => {
2206
+ const params = getParametersInstance();
2207
+ const inner = getBlueprintComponentBuilder().withType(buildSubnetType()).withParameters(params);
2208
+ const vmBuilders = [];
2209
+ const builder = {
2210
+ withId: (id) => {
2211
+ inner.withId(buildId$27(id));
2212
+ return builder;
2213
+ },
2214
+ withVersion: (major, minor, patch) => {
2215
+ inner.withVersion(buildVersion$27(major, minor, patch));
2216
+ return builder;
2217
+ },
2218
+ withDisplayName: (displayName) => {
2219
+ inner.withDisplayName(displayName);
2220
+ return builder;
2221
+ },
2222
+ withDescription: (description) => {
2223
+ inner.withDescription(description);
2224
+ return builder;
2225
+ },
2226
+ withCidrBlock: (value) => {
2227
+ pushParam$24(params, CIDR_BLOCK_PARAM, value);
2228
+ return builder;
2229
+ },
2230
+ withVirtualMachine: (vmBuilder) => {
2231
+ vmBuilders.push(vmBuilder);
2232
+ return builder;
2233
+ },
2234
+ withLinks: (links) => {
2235
+ inner.withLinks(links);
2236
+ return builder;
2237
+ },
2238
+ build: () => {
2239
+ const subnet = inner.build();
2240
+ const subnetDep = { id: subnet.id };
2241
+ const virtualMachines = vmBuilders.map((b) => ({
2242
+ ...b.build(),
2243
+ dependencies: [subnetDep]
2244
+ }));
2245
+ return {
2246
+ subnet,
2247
+ virtualMachines,
2248
+ components: [subnet, ...virtualMachines]
2249
+ };
2250
+ }
2251
+ };
2252
+ return builder;
2253
+ };
2254
+ _Subnet.create = (config) => {
2255
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
2256
+ if (config.cidrBlock) b.withCidrBlock(config.cidrBlock);
2257
+ if (config.description) b.withDescription(config.description);
2258
+ return makeSubnetNode(b.build().subnet, [], []);
2259
+ };
2260
+ })(Subnet || (Subnet = {}));
2261
+
2262
+ //#endregion
2263
+ //#region src/fractal/component/network_and_compute/iaas/security_group.ts
2264
+ const SECURITY_GROUP_TYPE_NAME = "SecurityGroup";
2265
+ const DESCRIPTION_PARAM = "description";
2266
+ const INGRESS_RULES_PARAM = "ingressRules";
2267
+ function buildId$26(id) {
2268
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2269
+ }
2270
+ function buildVersion$26(major, minor, patch) {
2271
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2272
+ }
2273
+ function buildSecurityGroupType() {
2274
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(SECURITY_GROUP_TYPE_NAME).build()).build();
2275
+ }
2276
+ function pushParam$23(params, key, value) {
2277
+ params.push(key, value);
2278
+ }
2279
+ let SecurityGroup;
2280
+ (function(_SecurityGroup) {
2281
+ const getBuilder = _SecurityGroup.getBuilder = () => {
2282
+ const params = getParametersInstance();
2283
+ const inner = getBlueprintComponentBuilder().withType(buildSecurityGroupType()).withParameters(params);
2284
+ const builder = {
2285
+ withId: (id) => {
2286
+ inner.withId(buildId$26(id));
2287
+ return builder;
2288
+ },
2289
+ withVersion: (major, minor, patch) => {
2290
+ inner.withVersion(buildVersion$26(major, minor, patch));
2291
+ return builder;
2292
+ },
2293
+ withDisplayName: (displayName) => {
2294
+ inner.withDisplayName(displayName);
2295
+ return builder;
2296
+ },
2297
+ withDescription: (description) => {
2298
+ inner.withDescription(description);
2299
+ pushParam$23(params, DESCRIPTION_PARAM, description);
2300
+ return builder;
2301
+ },
2302
+ withIngressRules: (rules) => {
2303
+ pushParam$23(params, INGRESS_RULES_PARAM, rules);
2304
+ return builder;
2305
+ },
2306
+ withLinks: (links) => {
2307
+ inner.withLinks(links);
2308
+ return builder;
2309
+ },
2310
+ build: () => inner.build()
2311
+ };
2312
+ return builder;
2313
+ };
2314
+ _SecurityGroup.create = (config) => {
2315
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withDescription(config.description);
2316
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
2317
+ return b.build();
2318
+ };
2319
+ })(SecurityGroup || (SecurityGroup = {}));
2320
+
2321
+ //#endregion
2322
+ //#region src/fractal/component/network_and_compute/iaas/vm.ts
2323
+ const VIRTUAL_MACHINE_TYPE_NAME = "VirtualMachine";
2324
+ function buildId$25(id) {
2325
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2326
+ }
2327
+ function buildVersion$25(major, minor, patch) {
2328
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2329
+ }
2330
+ function buildVirtualMachineType() {
2331
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(VIRTUAL_MACHINE_TYPE_NAME).build()).build();
2332
+ }
2333
+ function buildLinkParams$1(link) {
2334
+ const params = getParametersInstance();
2335
+ params.push("fromPort", link.fromPort);
2336
+ if (link.toPort !== void 0) params.push("toPort", link.toPort);
2337
+ if (link.protocol) params.push("protocol", link.protocol);
2338
+ return params;
2339
+ }
2340
+ function makeVirtualMachineNode(component) {
2341
+ return {
2342
+ component,
2343
+ components: [component],
2344
+ withLinks: (links) => {
2345
+ const componentLinks = links.map((l) => getLinkBuilder().withId(l.target.component.id).withType(buildVirtualMachineType()).withParameters(buildLinkParams$1(l)).build());
2346
+ return makeVirtualMachineNode({
2347
+ ...component,
2348
+ links: [...component.links, ...componentLinks]
2349
+ });
2350
+ }
2351
+ };
2352
+ }
2353
+ let VirtualMachine;
2354
+ (function(_VirtualMachine) {
2355
+ const getBuilder = _VirtualMachine.getBuilder = () => {
2356
+ const inner = getBlueprintComponentBuilder().withType(buildVirtualMachineType()).withParameters(getParametersInstance());
2357
+ const builder = {
2358
+ withId: (id) => {
2359
+ inner.withId(buildId$25(id));
2360
+ return builder;
2361
+ },
2362
+ withVersion: (major, minor, patch) => {
2363
+ inner.withVersion(buildVersion$25(major, minor, patch));
2364
+ return builder;
2365
+ },
2366
+ withDisplayName: (displayName) => {
2367
+ inner.withDisplayName(displayName);
2368
+ return builder;
2369
+ },
2370
+ withDescription: (description) => {
2371
+ inner.withDescription(description);
2372
+ return builder;
2373
+ },
2374
+ withLinks: (links) => {
2375
+ inner.withLinks(links);
2376
+ return builder;
2377
+ },
2378
+ build: () => inner.build()
2379
+ };
2380
+ return builder;
2381
+ };
2382
+ _VirtualMachine.create = (config) => {
2383
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
2384
+ if (config.description) b.withDescription(config.description);
2385
+ return makeVirtualMachineNode(b.build());
2386
+ };
2387
+ })(VirtualMachine || (VirtualMachine = {}));
2388
+
2389
+ //#endregion
2390
+ //#region src/live_system/component/network_and_compute/iaas/vpc.ts
2391
+ const AWS_VPC_TYPE_NAME = "AwsVpc";
2392
+ const INSTANCE_TENANCY_PARAM = "instanceTenancy";
2393
+ const ENABLE_DNS_SUPPORT_PARAM = "enableDnsSupport";
2394
+ const ENABLE_DNS_HOSTNAMES_PARAM = "enableDnsHostnames";
2395
+ function buildId$24(id) {
2396
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2397
+ }
2398
+ function buildVersion$24(major, minor, patch) {
2399
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2400
+ }
2401
+ function buildAwsVpcType() {
2402
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AWS_VPC_TYPE_NAME).build()).build();
2403
+ }
2404
+ function pushParam$22(params, key, value) {
2405
+ params.push(key, value);
2406
+ }
2407
+ let AwsVpc;
2408
+ (function(_AwsVpc) {
2409
+ const getBuilder = _AwsVpc.getBuilder = () => {
2410
+ const params = getParametersInstance();
2411
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsVpcType()).withParameters(params).withProvider("AWS");
2412
+ const builder = {
2413
+ withId: (id) => {
2414
+ inner.withId(buildId$24(id));
2415
+ return builder;
2416
+ },
2417
+ withVersion: (major, minor, patch) => {
2418
+ inner.withVersion(buildVersion$24(major, minor, patch));
2419
+ return builder;
2420
+ },
2421
+ withDisplayName: (displayName) => {
2422
+ inner.withDisplayName(displayName);
2423
+ return builder;
2424
+ },
2425
+ withDescription: (description) => {
2426
+ inner.withDescription(description);
2427
+ return builder;
2428
+ },
2429
+ withCidrBlock: (value) => {
2430
+ pushParam$22(params, CIDR_BLOCK_PARAM$1, value);
2431
+ return builder;
2432
+ },
2433
+ withInstanceTenancy: (value) => {
2434
+ pushParam$22(params, INSTANCE_TENANCY_PARAM, value);
2435
+ return builder;
2436
+ },
2437
+ withEnableDnsSupport: (value) => {
2438
+ pushParam$22(params, ENABLE_DNS_SUPPORT_PARAM, value);
2439
+ return builder;
2440
+ },
2441
+ withEnableDnsHostnames: (value) => {
2442
+ pushParam$22(params, ENABLE_DNS_HOSTNAMES_PARAM, value);
2443
+ return builder;
2444
+ },
2445
+ build: () => inner.build()
2446
+ };
2447
+ return builder;
2448
+ };
2449
+ _AwsVpc.satisfy = (blueprint) => {
2450
+ const params = getParametersInstance();
2451
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsVpcType()).withParameters(params).withProvider("AWS").withId(buildId$24(blueprint.id.toString())).withVersion(buildVersion$24(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
2452
+ if (blueprint.description) inner.withDescription(blueprint.description);
2453
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
2454
+ if (cidrBlock !== null) pushParam$22(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
2455
+ const satisfiedBuilder = {
2456
+ withInstanceTenancy: (value) => {
2457
+ pushParam$22(params, INSTANCE_TENANCY_PARAM, value);
2458
+ return satisfiedBuilder;
2459
+ },
2460
+ withEnableDnsSupport: (value) => {
2461
+ pushParam$22(params, ENABLE_DNS_SUPPORT_PARAM, value);
2462
+ return satisfiedBuilder;
2463
+ },
2464
+ withEnableDnsHostnames: (value) => {
2465
+ pushParam$22(params, ENABLE_DNS_HOSTNAMES_PARAM, value);
2466
+ return satisfiedBuilder;
2467
+ },
2468
+ build: () => inner.build()
2469
+ };
2470
+ return satisfiedBuilder;
2471
+ };
2472
+ _AwsVpc.create = (config) => {
2473
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock);
2474
+ if (config.description) b.withDescription(config.description);
2475
+ if (config.instanceTenancy) b.withInstanceTenancy(config.instanceTenancy);
2476
+ if (config.enableDnsSupport !== void 0) b.withEnableDnsSupport(config.enableDnsSupport);
2477
+ if (config.enableDnsHostnames !== void 0) b.withEnableDnsHostnames(config.enableDnsHostnames);
2478
+ return b.build();
2479
+ };
2480
+ })(AwsVpc || (AwsVpc = {}));
2481
+
2482
+ //#endregion
2483
+ //#region src/live_system/component/network_and_compute/iaas/subnet.ts
2484
+ const AWS_SUBNET_TYPE_NAME = "AwsSubnet";
2485
+ const AVAILABILITY_ZONE_PARAM = "availabilityZone";
2486
+ function buildId$23(id) {
2487
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2488
+ }
2489
+ function buildVersion$23(major, minor, patch) {
2490
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2491
+ }
2492
+ function buildAwsSubnetType() {
2493
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AWS_SUBNET_TYPE_NAME).build()).build();
2494
+ }
2495
+ function pushParam$21(params, key, value) {
2496
+ params.push(key, value);
2497
+ }
2498
+ let AwsSubnet;
2499
+ (function(_AwsSubnet) {
2500
+ const getBuilder = _AwsSubnet.getBuilder = () => {
2501
+ const params = getParametersInstance();
2502
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsSubnetType()).withParameters(params).withProvider("AWS");
2503
+ const builder = {
2504
+ withId: (id) => {
2505
+ inner.withId(buildId$23(id));
2506
+ return builder;
2507
+ },
2508
+ withVersion: (major, minor, patch) => {
2509
+ inner.withVersion(buildVersion$23(major, minor, patch));
2510
+ return builder;
2511
+ },
2512
+ withDisplayName: (displayName) => {
2513
+ inner.withDisplayName(displayName);
2514
+ return builder;
2515
+ },
2516
+ withDescription: (description) => {
2517
+ inner.withDescription(description);
2518
+ return builder;
2519
+ },
2520
+ withCidrBlock: (value) => {
2521
+ pushParam$21(params, CIDR_BLOCK_PARAM, value);
2522
+ return builder;
2523
+ },
2524
+ withAvailabilityZone: (value) => {
2525
+ pushParam$21(params, AVAILABILITY_ZONE_PARAM, value);
2526
+ return builder;
2527
+ },
2528
+ build: () => inner.build()
2529
+ };
2530
+ return builder;
2531
+ };
2532
+ _AwsSubnet.satisfy = (blueprint) => {
2533
+ const params = getParametersInstance();
2534
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsSubnetType()).withParameters(params).withProvider("AWS").withId(buildId$23(blueprint.id.toString())).withVersion(buildVersion$23(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
2535
+ if (blueprint.description) inner.withDescription(blueprint.description);
2536
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
2537
+ if (cidrBlock !== null) pushParam$21(params, CIDR_BLOCK_PARAM, String(cidrBlock));
2538
+ const satisfiedBuilder = {
2539
+ withAvailabilityZone: (value) => {
2540
+ pushParam$21(params, AVAILABILITY_ZONE_PARAM, value);
2541
+ return satisfiedBuilder;
2542
+ },
2543
+ build: () => inner.build()
2544
+ };
2545
+ return satisfiedBuilder;
2546
+ };
2547
+ _AwsSubnet.create = (config) => {
2548
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withAvailabilityZone(config.availabilityZone);
2549
+ if (config.description) b.withDescription(config.description);
2550
+ return b.build();
2551
+ };
2552
+ })(AwsSubnet || (AwsSubnet = {}));
2553
+
2554
+ //#endregion
2555
+ //#region src/live_system/component/network_and_compute/iaas/security_group.ts
2556
+ const AWS_SG_TYPE_NAME = "AwsSecurityGroup";
2557
+ function buildId$22(id) {
2558
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2559
+ }
2560
+ function buildVersion$22(major, minor, patch) {
2561
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2562
+ }
2563
+ function buildAwsSgType() {
2564
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AWS_SG_TYPE_NAME).build()).build();
2565
+ }
2566
+ function pushParam$20(params, key, value) {
2567
+ params.push(key, value);
2568
+ }
2569
+ let AwsSecurityGroup;
2570
+ (function(_AwsSecurityGroup) {
2571
+ const getBuilder = _AwsSecurityGroup.getBuilder = () => {
2572
+ const params = getParametersInstance();
2573
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsSgType()).withParameters(params).withProvider("AWS");
2574
+ const builder = {
2575
+ withId: (id) => {
2576
+ inner.withId(buildId$22(id));
2577
+ return builder;
2578
+ },
2579
+ withVersion: (major, minor, patch) => {
2580
+ inner.withVersion(buildVersion$22(major, minor, patch));
2581
+ return builder;
2582
+ },
2583
+ withDisplayName: (displayName) => {
2584
+ inner.withDisplayName(displayName);
2585
+ return builder;
2586
+ },
2587
+ withDescription: (description) => {
2588
+ inner.withDescription(description);
2589
+ pushParam$20(params, DESCRIPTION_PARAM, description);
2590
+ return builder;
2591
+ },
2592
+ withIngressRules: (rules) => {
2593
+ pushParam$20(params, INGRESS_RULES_PARAM, rules);
2594
+ return builder;
2595
+ },
2596
+ build: () => inner.build()
2597
+ };
2598
+ return builder;
2599
+ };
2600
+ _AwsSecurityGroup.satisfy = (blueprint) => {
2601
+ const params = getParametersInstance();
2602
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsSgType()).withParameters(params).withProvider("AWS").withId(buildId$22(blueprint.id.toString())).withVersion(buildVersion$22(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
2603
+ const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
2604
+ if (description !== null) {
2605
+ inner.withDescription(String(description));
2606
+ pushParam$20(params, DESCRIPTION_PARAM, String(description));
2607
+ } else if (blueprint.description) inner.withDescription(blueprint.description);
2608
+ const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
2609
+ if (ingressRules !== null) pushParam$20(params, INGRESS_RULES_PARAM, ingressRules);
2610
+ return { build: () => inner.build() };
2611
+ };
2612
+ _AwsSecurityGroup.create = (config) => {
2613
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withDescription(config.description);
2614
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
2615
+ return b.build();
2616
+ };
2617
+ })(AwsSecurityGroup || (AwsSecurityGroup = {}));
2618
+
2619
+ //#endregion
2620
+ //#region src/live_system/component/network_and_compute/iaas/ec2_instance.ts
2621
+ const EC2_TYPE_NAME = "EC2";
2622
+ const AMI_ID_PARAM = "amiId";
2623
+ const INSTANCE_TYPE_PARAM = "instanceType";
2624
+ const KEY_NAME_PARAM = "keyName";
2625
+ const USER_DATA_PARAM$1 = "userData";
2626
+ const IAM_INSTANCE_PROFILE_PARAM = "iamInstanceProfile";
2627
+ const ASSOCIATE_PUBLIC_IP_PARAM = "associatePublicIp";
2628
+ function buildId$21(id) {
2629
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2630
+ }
2631
+ function buildVersion$21(major, minor, patch) {
2632
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2633
+ }
2634
+ function buildEc2Type() {
2635
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(EC2_TYPE_NAME).build()).build();
2636
+ }
2637
+ function pushParam$19(params, key, value) {
2638
+ params.push(key, value);
2639
+ }
2640
+ let Ec2Instance;
2641
+ (function(_Ec2Instance) {
2642
+ const getBuilder = _Ec2Instance.getBuilder = () => {
2643
+ const params = getParametersInstance();
2644
+ const inner = getLiveSystemComponentBuilder().withType(buildEc2Type()).withParameters(params).withProvider("AWS");
2645
+ const builder = {
2646
+ withId: (id) => {
2647
+ inner.withId(buildId$21(id));
2648
+ return builder;
2649
+ },
2650
+ withVersion: (major, minor, patch) => {
2651
+ inner.withVersion(buildVersion$21(major, minor, patch));
2652
+ return builder;
2653
+ },
2654
+ withDisplayName: (displayName) => {
2655
+ inner.withDisplayName(displayName);
2656
+ return builder;
2657
+ },
2658
+ withDescription: (description) => {
2659
+ inner.withDescription(description);
2660
+ return builder;
2661
+ },
2662
+ withAmiId: (value) => {
2663
+ pushParam$19(params, AMI_ID_PARAM, value);
2664
+ return builder;
2665
+ },
2666
+ withInstanceType: (value) => {
2667
+ pushParam$19(params, INSTANCE_TYPE_PARAM, value);
2668
+ return builder;
2669
+ },
2670
+ withKeyName: (value) => {
2671
+ pushParam$19(params, KEY_NAME_PARAM, value);
2672
+ return builder;
2673
+ },
2674
+ withUserData: (value) => {
2675
+ pushParam$19(params, USER_DATA_PARAM$1, value);
2676
+ return builder;
2677
+ },
2678
+ withIamInstanceProfile: (value) => {
2679
+ pushParam$19(params, IAM_INSTANCE_PROFILE_PARAM, value);
2680
+ return builder;
2681
+ },
2682
+ withAssociatePublicIp: (value) => {
2683
+ pushParam$19(params, ASSOCIATE_PUBLIC_IP_PARAM, value);
2684
+ return builder;
2685
+ },
2686
+ build: () => inner.build()
2687
+ };
2688
+ return builder;
2689
+ };
2690
+ _Ec2Instance.satisfy = (blueprint) => {
2691
+ const params = getParametersInstance();
2692
+ const inner = getLiveSystemComponentBuilder().withType(buildEc2Type()).withParameters(params).withProvider("AWS").withId(buildId$21(blueprint.id.toString())).withVersion(buildVersion$21(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
2693
+ if (blueprint.description) inner.withDescription(blueprint.description);
2694
+ const satisfiedBuilder = {
2695
+ withAmiId: (value) => {
2696
+ pushParam$19(params, AMI_ID_PARAM, value);
2697
+ return satisfiedBuilder;
2698
+ },
2699
+ withInstanceType: (value) => {
2700
+ pushParam$19(params, INSTANCE_TYPE_PARAM, value);
2701
+ return satisfiedBuilder;
2702
+ },
2703
+ withKeyName: (value) => {
2704
+ pushParam$19(params, KEY_NAME_PARAM, value);
2705
+ return satisfiedBuilder;
2706
+ },
2707
+ withUserData: (value) => {
2708
+ pushParam$19(params, USER_DATA_PARAM$1, value);
2709
+ return satisfiedBuilder;
2710
+ },
2711
+ withIamInstanceProfile: (value) => {
2712
+ pushParam$19(params, IAM_INSTANCE_PROFILE_PARAM, value);
2713
+ return satisfiedBuilder;
2714
+ },
2715
+ withAssociatePublicIp: (value) => {
2716
+ pushParam$19(params, ASSOCIATE_PUBLIC_IP_PARAM, value);
2717
+ return satisfiedBuilder;
2718
+ },
2719
+ build: () => inner.build()
2720
+ };
2721
+ return satisfiedBuilder;
2722
+ };
2723
+ _Ec2Instance.create = (config) => {
2724
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withAmiId(config.amiId).withInstanceType(config.instanceType);
2725
+ if (config.description) b.withDescription(config.description);
2726
+ if (config.keyName) b.withKeyName(config.keyName);
2727
+ if (config.userData) b.withUserData(config.userData);
2728
+ if (config.iamInstanceProfile) b.withIamInstanceProfile(config.iamInstanceProfile);
2729
+ if (config.associatePublicIp !== void 0) b.withAssociatePublicIp(config.associatePublicIp);
2730
+ return b.build();
2731
+ };
2732
+ })(Ec2Instance || (Ec2Instance = {}));
2733
+
2734
+ //#endregion
2735
+ //#region src/live_system/component/network_and_compute/iaas/azure_vnet.ts
2736
+ const AZURE_VNET_TYPE_NAME = "AzureVnet";
2737
+ const LOCATION_PARAM$3 = "location";
2738
+ const RESOURCE_GROUP_PARAM$3 = "resourceGroup";
2739
+ function buildId$20(id) {
2740
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2741
+ }
2742
+ function buildVersion$20(major, minor, patch) {
2743
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2744
+ }
2745
+ function buildAzureVnetType() {
2746
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_VNET_TYPE_NAME).build()).build();
2747
+ }
2748
+ function pushParam$18(params, key, value) {
2749
+ params.push(key, value);
2750
+ }
2751
+ let AzureVnet;
2752
+ (function(_AzureVnet) {
2753
+ const getBuilder = _AzureVnet.getBuilder = () => {
2754
+ const params = getParametersInstance();
2755
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureVnetType()).withParameters(params).withProvider("Azure");
2756
+ const builder = {
2757
+ withId: (id) => {
2758
+ inner.withId(buildId$20(id));
2759
+ return builder;
2760
+ },
2761
+ withVersion: (major, minor, patch) => {
2762
+ inner.withVersion(buildVersion$20(major, minor, patch));
2763
+ return builder;
2764
+ },
2765
+ withDisplayName: (displayName) => {
2766
+ inner.withDisplayName(displayName);
2767
+ return builder;
2768
+ },
2769
+ withDescription: (description) => {
2770
+ inner.withDescription(description);
2771
+ return builder;
2772
+ },
2773
+ withCidrBlock: (value) => {
2774
+ pushParam$18(params, CIDR_BLOCK_PARAM$1, value);
2775
+ return builder;
2776
+ },
2777
+ withLocation: (value) => {
2778
+ pushParam$18(params, LOCATION_PARAM$3, value);
2779
+ return builder;
2780
+ },
2781
+ withResourceGroup: (value) => {
2782
+ pushParam$18(params, RESOURCE_GROUP_PARAM$3, value);
2783
+ return builder;
2784
+ },
2785
+ build: () => inner.build()
2786
+ };
2787
+ return builder;
2788
+ };
2789
+ _AzureVnet.satisfy = (blueprint) => {
2790
+ const params = getParametersInstance();
2791
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureVnetType()).withParameters(params).withProvider("Azure").withId(buildId$20(blueprint.id.toString())).withVersion(buildVersion$20(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
2792
+ if (blueprint.description) inner.withDescription(blueprint.description);
2793
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
2794
+ if (cidrBlock !== null) pushParam$18(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
2795
+ const satisfiedBuilder = {
2796
+ withLocation: (value) => {
2797
+ pushParam$18(params, LOCATION_PARAM$3, value);
2798
+ return satisfiedBuilder;
2799
+ },
2800
+ withResourceGroup: (value) => {
2801
+ pushParam$18(params, RESOURCE_GROUP_PARAM$3, value);
2802
+ return satisfiedBuilder;
2803
+ },
2804
+ build: () => inner.build()
2805
+ };
2806
+ return satisfiedBuilder;
2807
+ };
2808
+ _AzureVnet.create = (config) => {
2809
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withLocation(config.location).withResourceGroup(config.resourceGroup);
2810
+ if (config.description) b.withDescription(config.description);
2811
+ return b.build();
2812
+ };
2813
+ })(AzureVnet || (AzureVnet = {}));
2814
+
2815
+ //#endregion
2816
+ //#region src/live_system/component/network_and_compute/iaas/azure_subnet.ts
2817
+ const AZURE_SUBNET_TYPE_NAME = "AzureSubnet";
2818
+ const RESOURCE_GROUP_PARAM$2 = "resourceGroup";
2819
+ function buildId$19(id) {
2820
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2821
+ }
2822
+ function buildVersion$19(major, minor, patch) {
2823
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2824
+ }
2825
+ function buildAzureSubnetType() {
2826
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_SUBNET_TYPE_NAME).build()).build();
2827
+ }
2828
+ function pushParam$17(params, key, value) {
2829
+ params.push(key, value);
2830
+ }
2831
+ let AzureSubnet;
2832
+ (function(_AzureSubnet) {
2833
+ const getBuilder = _AzureSubnet.getBuilder = () => {
2834
+ const params = getParametersInstance();
2835
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureSubnetType()).withParameters(params).withProvider("Azure");
2836
+ const builder = {
2837
+ withId: (id) => {
2838
+ inner.withId(buildId$19(id));
2839
+ return builder;
2840
+ },
2841
+ withVersion: (major, minor, patch) => {
2842
+ inner.withVersion(buildVersion$19(major, minor, patch));
2843
+ return builder;
2844
+ },
2845
+ withDisplayName: (displayName) => {
2846
+ inner.withDisplayName(displayName);
2847
+ return builder;
2848
+ },
2849
+ withDescription: (description) => {
2850
+ inner.withDescription(description);
2851
+ return builder;
2852
+ },
2853
+ withCidrBlock: (value) => {
2854
+ pushParam$17(params, CIDR_BLOCK_PARAM, value);
2855
+ return builder;
2856
+ },
2857
+ withResourceGroup: (value) => {
2858
+ pushParam$17(params, RESOURCE_GROUP_PARAM$2, value);
2859
+ return builder;
2860
+ },
2861
+ build: () => inner.build()
2862
+ };
2863
+ return builder;
2864
+ };
2865
+ _AzureSubnet.satisfy = (blueprint) => {
2866
+ const params = getParametersInstance();
2867
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureSubnetType()).withParameters(params).withProvider("Azure").withId(buildId$19(blueprint.id.toString())).withVersion(buildVersion$19(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
2868
+ if (blueprint.description) inner.withDescription(blueprint.description);
2869
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
2870
+ if (cidrBlock !== null) pushParam$17(params, CIDR_BLOCK_PARAM, String(cidrBlock));
2871
+ const satisfiedBuilder = {
2872
+ withResourceGroup: (value) => {
2873
+ pushParam$17(params, RESOURCE_GROUP_PARAM$2, value);
2874
+ return satisfiedBuilder;
2875
+ },
2876
+ build: () => inner.build()
2877
+ };
2878
+ return satisfiedBuilder;
2879
+ };
2880
+ _AzureSubnet.create = (config) => {
2881
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withResourceGroup(config.resourceGroup);
2882
+ if (config.description) b.withDescription(config.description);
2883
+ return b.build();
2884
+ };
2885
+ })(AzureSubnet || (AzureSubnet = {}));
2886
+
2887
+ //#endregion
2888
+ //#region src/live_system/component/network_and_compute/iaas/azure_nsg.ts
2889
+ const AZURE_NSG_TYPE_NAME = "AzureNsg";
2890
+ const LOCATION_PARAM$2 = "location";
2891
+ const RESOURCE_GROUP_PARAM$1 = "resourceGroup";
2892
+ function buildId$18(id) {
2893
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2894
+ }
2895
+ function buildVersion$18(major, minor, patch) {
2896
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2897
+ }
2898
+ function buildAzureNsgType() {
2899
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_NSG_TYPE_NAME).build()).build();
2900
+ }
2901
+ function pushParam$16(params, key, value) {
2902
+ params.push(key, value);
2903
+ }
2904
+ let AzureNsg;
2905
+ (function(_AzureNsg) {
2906
+ const getBuilder = _AzureNsg.getBuilder = () => {
2907
+ const params = getParametersInstance();
2908
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureNsgType()).withParameters(params).withProvider("Azure");
2909
+ const builder = {
2910
+ withId: (id) => {
2911
+ inner.withId(buildId$18(id));
2912
+ return builder;
2913
+ },
2914
+ withVersion: (major, minor, patch) => {
2915
+ inner.withVersion(buildVersion$18(major, minor, patch));
2916
+ return builder;
2917
+ },
2918
+ withDisplayName: (displayName) => {
2919
+ inner.withDisplayName(displayName);
2920
+ return builder;
2921
+ },
2922
+ withDescription: (description) => {
2923
+ inner.withDescription(description);
2924
+ pushParam$16(params, DESCRIPTION_PARAM, description);
2925
+ return builder;
2926
+ },
2927
+ withIngressRules: (rules) => {
2928
+ pushParam$16(params, INGRESS_RULES_PARAM, rules);
2929
+ return builder;
2930
+ },
2931
+ withLocation: (value) => {
2932
+ pushParam$16(params, LOCATION_PARAM$2, value);
2933
+ return builder;
2934
+ },
2935
+ withResourceGroup: (value) => {
2936
+ pushParam$16(params, RESOURCE_GROUP_PARAM$1, value);
2937
+ return builder;
2938
+ },
2939
+ build: () => inner.build()
2940
+ };
2941
+ return builder;
2942
+ };
2943
+ _AzureNsg.satisfy = (blueprint) => {
2944
+ const params = getParametersInstance();
2945
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureNsgType()).withParameters(params).withProvider("Azure").withId(buildId$18(blueprint.id.toString())).withVersion(buildVersion$18(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
2946
+ const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
2947
+ if (description !== null) {
2948
+ inner.withDescription(String(description));
2949
+ pushParam$16(params, DESCRIPTION_PARAM, String(description));
2950
+ } else if (blueprint.description) inner.withDescription(blueprint.description);
2951
+ const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
2952
+ if (ingressRules !== null) pushParam$16(params, INGRESS_RULES_PARAM, ingressRules);
2953
+ const satisfiedBuilder = {
2954
+ withLocation: (value) => {
2955
+ pushParam$16(params, LOCATION_PARAM$2, value);
2956
+ return satisfiedBuilder;
2957
+ },
2958
+ withResourceGroup: (value) => {
2959
+ pushParam$16(params, RESOURCE_GROUP_PARAM$1, value);
2960
+ return satisfiedBuilder;
2961
+ },
2962
+ build: () => inner.build()
2963
+ };
2964
+ return satisfiedBuilder;
2965
+ };
2966
+ _AzureNsg.create = (config) => {
2967
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withLocation(config.location).withResourceGroup(config.resourceGroup);
2968
+ if (config.description) b.withDescription(config.description);
2969
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
2970
+ return b.build();
2971
+ };
2972
+ })(AzureNsg || (AzureNsg = {}));
2973
+
2974
+ //#endregion
2975
+ //#region src/live_system/component/network_and_compute/iaas/azure_vm.ts
2976
+ const AZURE_VM_TYPE_NAME = "AzureVm";
2977
+ const VM_SIZE_PARAM = "vmSize";
2978
+ const LOCATION_PARAM$1 = "location";
2979
+ const RESOURCE_GROUP_PARAM = "resourceGroup";
2980
+ const ADMIN_USERNAME_PARAM = "adminUsername";
2981
+ const IMAGE_PUBLISHER_PARAM = "imagePublisher";
2982
+ const IMAGE_OFFER_PARAM = "imageOffer";
2983
+ const IMAGE_SKU_PARAM = "imageSku";
2984
+ const SSH_PUBLIC_KEY_PARAM$1 = "sshPublicKey";
2985
+ const OS_DISK_SIZE_GB_PARAM = "osDiskSizeGb";
2986
+ function buildId$17(id) {
2987
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2988
+ }
2989
+ function buildVersion$17(major, minor, patch) {
2990
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2991
+ }
2992
+ function buildAzureVmType() {
2993
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_VM_TYPE_NAME).build()).build();
2994
+ }
2995
+ function pushParam$15(params, key, value) {
2996
+ params.push(key, value);
2997
+ }
2998
+ let AzureVm;
2999
+ (function(_AzureVm) {
3000
+ const getBuilder = _AzureVm.getBuilder = () => {
3001
+ const params = getParametersInstance();
3002
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureVmType()).withParameters(params).withProvider("Azure");
3003
+ const builder = {
3004
+ withId: (id) => {
3005
+ inner.withId(buildId$17(id));
3006
+ return builder;
3007
+ },
3008
+ withVersion: (major, minor, patch) => {
3009
+ inner.withVersion(buildVersion$17(major, minor, patch));
3010
+ return builder;
3011
+ },
3012
+ withDisplayName: (displayName) => {
3013
+ inner.withDisplayName(displayName);
3014
+ return builder;
3015
+ },
3016
+ withDescription: (description) => {
3017
+ inner.withDescription(description);
3018
+ return builder;
3019
+ },
3020
+ withVmSize: (value) => {
3021
+ pushParam$15(params, VM_SIZE_PARAM, value);
3022
+ return builder;
3023
+ },
3024
+ withLocation: (value) => {
3025
+ pushParam$15(params, LOCATION_PARAM$1, value);
3026
+ return builder;
3027
+ },
3028
+ withResourceGroup: (value) => {
3029
+ pushParam$15(params, RESOURCE_GROUP_PARAM, value);
3030
+ return builder;
3031
+ },
3032
+ withAdminUsername: (value) => {
3033
+ pushParam$15(params, ADMIN_USERNAME_PARAM, value);
3034
+ return builder;
3035
+ },
3036
+ withImagePublisher: (value) => {
3037
+ pushParam$15(params, IMAGE_PUBLISHER_PARAM, value);
3038
+ return builder;
3039
+ },
3040
+ withImageOffer: (value) => {
3041
+ pushParam$15(params, IMAGE_OFFER_PARAM, value);
3042
+ return builder;
3043
+ },
3044
+ withImageSku: (value) => {
3045
+ pushParam$15(params, IMAGE_SKU_PARAM, value);
3046
+ return builder;
3047
+ },
3048
+ withSshPublicKey: (value) => {
3049
+ pushParam$15(params, SSH_PUBLIC_KEY_PARAM$1, value);
3050
+ return builder;
3051
+ },
3052
+ withOsDiskSizeGb: (value) => {
3053
+ pushParam$15(params, OS_DISK_SIZE_GB_PARAM, value);
3054
+ return builder;
3055
+ },
3056
+ build: () => inner.build()
3057
+ };
3058
+ return builder;
3059
+ };
3060
+ _AzureVm.satisfy = (blueprint) => {
3061
+ const params = getParametersInstance();
3062
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureVmType()).withParameters(params).withProvider("Azure").withId(buildId$17(blueprint.id.toString())).withVersion(buildVersion$17(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3063
+ if (blueprint.description) inner.withDescription(blueprint.description);
3064
+ const satisfiedBuilder = {
3065
+ withVmSize: (value) => {
3066
+ pushParam$15(params, VM_SIZE_PARAM, value);
3067
+ return satisfiedBuilder;
3068
+ },
3069
+ withLocation: (value) => {
3070
+ pushParam$15(params, LOCATION_PARAM$1, value);
3071
+ return satisfiedBuilder;
3072
+ },
3073
+ withResourceGroup: (value) => {
3074
+ pushParam$15(params, RESOURCE_GROUP_PARAM, value);
3075
+ return satisfiedBuilder;
3076
+ },
3077
+ withAdminUsername: (value) => {
3078
+ pushParam$15(params, ADMIN_USERNAME_PARAM, value);
3079
+ return satisfiedBuilder;
3080
+ },
3081
+ withImagePublisher: (value) => {
3082
+ pushParam$15(params, IMAGE_PUBLISHER_PARAM, value);
3083
+ return satisfiedBuilder;
3084
+ },
3085
+ withImageOffer: (value) => {
3086
+ pushParam$15(params, IMAGE_OFFER_PARAM, value);
3087
+ return satisfiedBuilder;
3088
+ },
3089
+ withImageSku: (value) => {
3090
+ pushParam$15(params, IMAGE_SKU_PARAM, value);
3091
+ return satisfiedBuilder;
3092
+ },
3093
+ withSshPublicKey: (value) => {
3094
+ pushParam$15(params, SSH_PUBLIC_KEY_PARAM$1, value);
3095
+ return satisfiedBuilder;
3096
+ },
3097
+ withOsDiskSizeGb: (value) => {
3098
+ pushParam$15(params, OS_DISK_SIZE_GB_PARAM, value);
3099
+ return satisfiedBuilder;
3100
+ },
3101
+ build: () => inner.build()
3102
+ };
3103
+ return satisfiedBuilder;
3104
+ };
3105
+ _AzureVm.create = (config) => {
3106
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withVmSize(config.vmSize).withLocation(config.location).withResourceGroup(config.resourceGroup).withAdminUsername(config.adminUsername).withImagePublisher(config.imagePublisher).withImageOffer(config.imageOffer).withImageSku(config.imageSku);
3107
+ if (config.description) b.withDescription(config.description);
3108
+ if (config.sshPublicKey) b.withSshPublicKey(config.sshPublicKey);
3109
+ if (config.osDiskSizeGb !== void 0) b.withOsDiskSizeGb(config.osDiskSizeGb);
3110
+ return b.build();
3111
+ };
3112
+ })(AzureVm || (AzureVm = {}));
3113
+
3114
+ //#endregion
3115
+ //#region src/live_system/component/network_and_compute/iaas/gcp_vpc.ts
3116
+ const GCP_VPC_TYPE_NAME = "GcpVpc";
3117
+ const AUTO_CREATE_SUBNETWORKS_PARAM = "autoCreateSubnetworks";
3118
+ const ROUTING_MODE_PARAM = "routingMode";
3119
+ function buildId$16(id) {
3120
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3121
+ }
3122
+ function buildVersion$16(major, minor, patch) {
3123
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3124
+ }
3125
+ function buildGcpVpcType() {
3126
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_VPC_TYPE_NAME).build()).build();
3127
+ }
3128
+ function pushParam$14(params, key, value) {
3129
+ params.push(key, value);
3130
+ }
3131
+ let GcpVpc;
3132
+ (function(_GcpVpc) {
3133
+ const getBuilder = _GcpVpc.getBuilder = () => {
3134
+ const params = getParametersInstance();
3135
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpVpcType()).withParameters(params).withProvider("GCP");
3136
+ const builder = {
3137
+ withId: (id) => {
3138
+ inner.withId(buildId$16(id));
3139
+ return builder;
3140
+ },
3141
+ withVersion: (major, minor, patch) => {
3142
+ inner.withVersion(buildVersion$16(major, minor, patch));
3143
+ return builder;
3144
+ },
3145
+ withDisplayName: (displayName) => {
3146
+ inner.withDisplayName(displayName);
3147
+ return builder;
3148
+ },
3149
+ withDescription: (description) => {
3150
+ inner.withDescription(description);
3151
+ return builder;
3152
+ },
3153
+ withCidrBlock: (value) => {
3154
+ pushParam$14(params, CIDR_BLOCK_PARAM$1, value);
3155
+ return builder;
3156
+ },
3157
+ withAutoCreateSubnetworks: (value) => {
3158
+ pushParam$14(params, AUTO_CREATE_SUBNETWORKS_PARAM, value);
3159
+ return builder;
3160
+ },
3161
+ withRoutingMode: (value) => {
3162
+ pushParam$14(params, ROUTING_MODE_PARAM, value);
3163
+ return builder;
3164
+ },
3165
+ build: () => inner.build()
3166
+ };
3167
+ return builder;
3168
+ };
3169
+ _GcpVpc.satisfy = (blueprint) => {
3170
+ const params = getParametersInstance();
3171
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpVpcType()).withParameters(params).withProvider("GCP").withId(buildId$16(blueprint.id.toString())).withVersion(buildVersion$16(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3172
+ if (blueprint.description) inner.withDescription(blueprint.description);
3173
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
3174
+ if (cidrBlock !== null) pushParam$14(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
3175
+ const satisfiedBuilder = {
3176
+ withAutoCreateSubnetworks: (value) => {
3177
+ pushParam$14(params, AUTO_CREATE_SUBNETWORKS_PARAM, value);
3178
+ return satisfiedBuilder;
3179
+ },
3180
+ withRoutingMode: (value) => {
3181
+ pushParam$14(params, ROUTING_MODE_PARAM, value);
3182
+ return satisfiedBuilder;
3183
+ },
3184
+ build: () => inner.build()
3185
+ };
3186
+ return satisfiedBuilder;
3187
+ };
3188
+ _GcpVpc.create = (config) => {
3189
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock);
3190
+ if (config.description) b.withDescription(config.description);
3191
+ if (config.autoCreateSubnetworks !== void 0) b.withAutoCreateSubnetworks(config.autoCreateSubnetworks);
3192
+ if (config.routingMode) b.withRoutingMode(config.routingMode);
3193
+ return b.build();
3194
+ };
3195
+ })(GcpVpc || (GcpVpc = {}));
3196
+
3197
+ //#endregion
3198
+ //#region src/live_system/component/network_and_compute/iaas/gcp_subnet.ts
3199
+ const GCP_SUBNET_TYPE_NAME = "GcpSubnet";
3200
+ const REGION_PARAM = "region";
3201
+ const PRIVATE_IP_GOOGLE_ACCESS_PARAM = "privateIpGoogleAccess";
3202
+ function buildId$15(id) {
3203
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3204
+ }
3205
+ function buildVersion$15(major, minor, patch) {
3206
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3207
+ }
3208
+ function buildGcpSubnetType() {
3209
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_SUBNET_TYPE_NAME).build()).build();
3210
+ }
3211
+ function pushParam$13(params, key, value) {
3212
+ params.push(key, value);
3213
+ }
3214
+ let GcpSubnet;
3215
+ (function(_GcpSubnet) {
3216
+ const getBuilder = _GcpSubnet.getBuilder = () => {
3217
+ const params = getParametersInstance();
3218
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpSubnetType()).withParameters(params).withProvider("GCP");
3219
+ const builder = {
3220
+ withId: (id) => {
3221
+ inner.withId(buildId$15(id));
3222
+ return builder;
3223
+ },
3224
+ withVersion: (major, minor, patch) => {
3225
+ inner.withVersion(buildVersion$15(major, minor, patch));
3226
+ return builder;
3227
+ },
3228
+ withDisplayName: (displayName) => {
3229
+ inner.withDisplayName(displayName);
3230
+ return builder;
3231
+ },
3232
+ withDescription: (description) => {
3233
+ inner.withDescription(description);
3234
+ return builder;
3235
+ },
3236
+ withCidrBlock: (value) => {
3237
+ pushParam$13(params, CIDR_BLOCK_PARAM, value);
3238
+ return builder;
3239
+ },
3240
+ withRegion: (value) => {
3241
+ pushParam$13(params, REGION_PARAM, value);
3242
+ return builder;
3243
+ },
3244
+ withPrivateIpGoogleAccess: (value) => {
3245
+ pushParam$13(params, PRIVATE_IP_GOOGLE_ACCESS_PARAM, value);
3246
+ return builder;
3247
+ },
3248
+ build: () => inner.build()
3249
+ };
3250
+ return builder;
3251
+ };
3252
+ _GcpSubnet.satisfy = (blueprint) => {
3253
+ const params = getParametersInstance();
3254
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpSubnetType()).withParameters(params).withProvider("GCP").withId(buildId$15(blueprint.id.toString())).withVersion(buildVersion$15(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3255
+ if (blueprint.description) inner.withDescription(blueprint.description);
3256
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
3257
+ if (cidrBlock !== null) pushParam$13(params, CIDR_BLOCK_PARAM, String(cidrBlock));
3258
+ const satisfiedBuilder = {
3259
+ withRegion: (value) => {
3260
+ pushParam$13(params, REGION_PARAM, value);
3261
+ return satisfiedBuilder;
3262
+ },
3263
+ withPrivateIpGoogleAccess: (value) => {
3264
+ pushParam$13(params, PRIVATE_IP_GOOGLE_ACCESS_PARAM, value);
3265
+ return satisfiedBuilder;
3266
+ },
3267
+ build: () => inner.build()
3268
+ };
3269
+ return satisfiedBuilder;
3270
+ };
3271
+ _GcpSubnet.create = (config) => {
3272
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withRegion(config.region);
3273
+ if (config.description) b.withDescription(config.description);
3274
+ if (config.privateIpGoogleAccess !== void 0) b.withPrivateIpGoogleAccess(config.privateIpGoogleAccess);
3275
+ return b.build();
3276
+ };
3277
+ })(GcpSubnet || (GcpSubnet = {}));
3278
+
3279
+ //#endregion
3280
+ //#region src/live_system/component/network_and_compute/iaas/gcp_firewall.ts
3281
+ const GCP_FIREWALL_TYPE_NAME = "GcpFirewall";
3282
+ function buildId$14(id) {
3283
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3284
+ }
3285
+ function buildVersion$14(major, minor, patch) {
3286
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3287
+ }
3288
+ function buildGcpFirewallType() {
3289
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_FIREWALL_TYPE_NAME).build()).build();
3290
+ }
3291
+ function pushParam$12(params, key, value) {
3292
+ params.push(key, value);
3293
+ }
3294
+ let GcpFirewall;
3295
+ (function(_GcpFirewall) {
3296
+ const getBuilder = _GcpFirewall.getBuilder = () => {
3297
+ const params = getParametersInstance();
3298
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpFirewallType()).withParameters(params).withProvider("GCP");
3299
+ const builder = {
3300
+ withId: (id) => {
3301
+ inner.withId(buildId$14(id));
3302
+ return builder;
3303
+ },
3304
+ withVersion: (major, minor, patch) => {
3305
+ inner.withVersion(buildVersion$14(major, minor, patch));
3306
+ return builder;
3307
+ },
3308
+ withDisplayName: (displayName) => {
3309
+ inner.withDisplayName(displayName);
3310
+ return builder;
3311
+ },
3312
+ withDescription: (description) => {
3313
+ inner.withDescription(description);
3314
+ pushParam$12(params, DESCRIPTION_PARAM, description);
3315
+ return builder;
3316
+ },
3317
+ withIngressRules: (rules) => {
3318
+ pushParam$12(params, INGRESS_RULES_PARAM, rules);
3319
+ return builder;
3320
+ },
3321
+ build: () => inner.build()
3322
+ };
3323
+ return builder;
3324
+ };
3325
+ _GcpFirewall.satisfy = (blueprint) => {
3326
+ const params = getParametersInstance();
3327
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpFirewallType()).withParameters(params).withProvider("GCP").withId(buildId$14(blueprint.id.toString())).withVersion(buildVersion$14(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3328
+ const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
3329
+ if (description !== null) {
3330
+ inner.withDescription(String(description));
3331
+ pushParam$12(params, DESCRIPTION_PARAM, String(description));
3332
+ } else if (blueprint.description) inner.withDescription(blueprint.description);
3333
+ const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
3334
+ if (ingressRules !== null) pushParam$12(params, INGRESS_RULES_PARAM, ingressRules);
3335
+ return { build: () => inner.build() };
3336
+ };
3337
+ _GcpFirewall.create = (config) => {
3338
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
3339
+ if (config.description) b.withDescription(config.description);
3340
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
3341
+ return b.build();
3342
+ };
3343
+ })(GcpFirewall || (GcpFirewall = {}));
3344
+
3345
+ //#endregion
3346
+ //#region src/live_system/component/network_and_compute/iaas/gcp_vm.ts
3347
+ const GCP_VM_TYPE_NAME = "GcpVm";
3348
+ const MACHINE_TYPE_PARAM = "machineType";
3349
+ const ZONE_PARAM = "zone";
3350
+ const IMAGE_PROJECT_PARAM = "imageProject";
3351
+ const IMAGE_FAMILY_PARAM = "imageFamily";
3352
+ const SERVICE_ACCOUNT_EMAIL_PARAM = "serviceAccountEmail";
3353
+ function buildId$13(id) {
3354
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3355
+ }
3356
+ function buildVersion$13(major, minor, patch) {
3357
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3358
+ }
3359
+ function buildGcpVmType() {
3360
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_VM_TYPE_NAME).build()).build();
3361
+ }
3362
+ function pushParam$11(params, key, value) {
3363
+ params.push(key, value);
3364
+ }
3365
+ let GcpVm;
3366
+ (function(_GcpVm) {
3367
+ const getBuilder = _GcpVm.getBuilder = () => {
3368
+ const params = getParametersInstance();
3369
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpVmType()).withParameters(params).withProvider("GCP");
3370
+ const builder = {
3371
+ withId: (id) => {
3372
+ inner.withId(buildId$13(id));
3373
+ return builder;
3374
+ },
3375
+ withVersion: (major, minor, patch) => {
3376
+ inner.withVersion(buildVersion$13(major, minor, patch));
3377
+ return builder;
3378
+ },
3379
+ withDisplayName: (displayName) => {
3380
+ inner.withDisplayName(displayName);
3381
+ return builder;
3382
+ },
3383
+ withDescription: (description) => {
3384
+ inner.withDescription(description);
3385
+ return builder;
3386
+ },
3387
+ withMachineType: (value) => {
3388
+ pushParam$11(params, MACHINE_TYPE_PARAM, value);
3389
+ return builder;
3390
+ },
3391
+ withZone: (value) => {
3392
+ pushParam$11(params, ZONE_PARAM, value);
3393
+ return builder;
3394
+ },
3395
+ withImageProject: (value) => {
3396
+ pushParam$11(params, IMAGE_PROJECT_PARAM, value);
3397
+ return builder;
3398
+ },
3399
+ withImageFamily: (value) => {
3400
+ pushParam$11(params, IMAGE_FAMILY_PARAM, value);
3401
+ return builder;
3402
+ },
3403
+ withServiceAccountEmail: (value) => {
3404
+ pushParam$11(params, SERVICE_ACCOUNT_EMAIL_PARAM, value);
3405
+ return builder;
3406
+ },
3407
+ build: () => inner.build()
3408
+ };
3409
+ return builder;
3410
+ };
3411
+ _GcpVm.satisfy = (blueprint) => {
3412
+ const params = getParametersInstance();
3413
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpVmType()).withParameters(params).withProvider("GCP").withId(buildId$13(blueprint.id.toString())).withVersion(buildVersion$13(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3414
+ if (blueprint.description) inner.withDescription(blueprint.description);
3415
+ const satisfiedBuilder = {
3416
+ withMachineType: (value) => {
3417
+ pushParam$11(params, MACHINE_TYPE_PARAM, value);
3418
+ return satisfiedBuilder;
3419
+ },
3420
+ withZone: (value) => {
3421
+ pushParam$11(params, ZONE_PARAM, value);
3422
+ return satisfiedBuilder;
3423
+ },
3424
+ withImageProject: (value) => {
3425
+ pushParam$11(params, IMAGE_PROJECT_PARAM, value);
3426
+ return satisfiedBuilder;
3427
+ },
3428
+ withImageFamily: (value) => {
3429
+ pushParam$11(params, IMAGE_FAMILY_PARAM, value);
3430
+ return satisfiedBuilder;
3431
+ },
3432
+ withServiceAccountEmail: (value) => {
3433
+ pushParam$11(params, SERVICE_ACCOUNT_EMAIL_PARAM, value);
3434
+ return satisfiedBuilder;
3435
+ },
3436
+ build: () => inner.build()
3437
+ };
3438
+ return satisfiedBuilder;
3439
+ };
3440
+ _GcpVm.create = (config) => {
3441
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withMachineType(config.machineType).withZone(config.zone).withImageProject(config.imageProject);
3442
+ if (config.description) b.withDescription(config.description);
3443
+ if (config.imageFamily) b.withImageFamily(config.imageFamily);
3444
+ if (config.serviceAccountEmail) b.withServiceAccountEmail(config.serviceAccountEmail);
3445
+ return b.build();
3446
+ };
3447
+ })(GcpVm || (GcpVm = {}));
3448
+
3449
+ //#endregion
3450
+ //#region src/live_system/component/network_and_compute/iaas/oci_vcn.ts
3451
+ const OCI_VCN_TYPE_NAME = "OciVcn";
3452
+ const COMPARTMENT_ID_PARAM$3 = "compartmentId";
3453
+ function buildId$12(id) {
3454
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3455
+ }
3456
+ function buildVersion$12(major, minor, patch) {
3457
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3458
+ }
3459
+ function buildOciVcnType() {
3460
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_VCN_TYPE_NAME).build()).build();
3461
+ }
3462
+ function pushParam$10(params, key, value) {
3463
+ params.push(key, value);
3464
+ }
3465
+ let OciVcn;
3466
+ (function(_OciVcn) {
3467
+ const getBuilder = _OciVcn.getBuilder = () => {
3468
+ const params = getParametersInstance();
3469
+ const inner = getLiveSystemComponentBuilder().withType(buildOciVcnType()).withParameters(params).withProvider("OCI");
3470
+ const builder = {
3471
+ withId: (id) => {
3472
+ inner.withId(buildId$12(id));
3473
+ return builder;
3474
+ },
3475
+ withVersion: (major, minor, patch) => {
3476
+ inner.withVersion(buildVersion$12(major, minor, patch));
3477
+ return builder;
3478
+ },
3479
+ withDisplayName: (displayName) => {
3480
+ inner.withDisplayName(displayName);
3481
+ return builder;
3482
+ },
3483
+ withDescription: (description) => {
3484
+ inner.withDescription(description);
3485
+ return builder;
3486
+ },
3487
+ withCidrBlock: (value) => {
3488
+ pushParam$10(params, CIDR_BLOCK_PARAM$1, value);
3489
+ return builder;
3490
+ },
3491
+ withCompartmentId: (value) => {
3492
+ pushParam$10(params, COMPARTMENT_ID_PARAM$3, value);
3493
+ return builder;
3494
+ },
3495
+ build: () => inner.build()
3496
+ };
3497
+ return builder;
3498
+ };
3499
+ _OciVcn.satisfy = (blueprint) => {
3500
+ const params = getParametersInstance();
3501
+ const inner = getLiveSystemComponentBuilder().withType(buildOciVcnType()).withParameters(params).withProvider("OCI").withId(buildId$12(blueprint.id.toString())).withVersion(buildVersion$12(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3502
+ if (blueprint.description) inner.withDescription(blueprint.description);
3503
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
3504
+ if (cidrBlock !== null) pushParam$10(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
3505
+ const satisfiedBuilder = {
3506
+ withCompartmentId: (value) => {
3507
+ pushParam$10(params, COMPARTMENT_ID_PARAM$3, value);
3508
+ return satisfiedBuilder;
3509
+ },
3510
+ build: () => inner.build()
3511
+ };
3512
+ return satisfiedBuilder;
3513
+ };
3514
+ _OciVcn.create = (config) => {
3515
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withCompartmentId(config.compartmentId);
3516
+ if (config.description) b.withDescription(config.description);
3517
+ return b.build();
3518
+ };
3519
+ })(OciVcn || (OciVcn = {}));
3520
+
3521
+ //#endregion
3522
+ //#region src/live_system/component/network_and_compute/iaas/oci_subnet.ts
3523
+ const OCI_SUBNET_TYPE_NAME = "OciSubnet";
3524
+ const COMPARTMENT_ID_PARAM$2 = "compartmentId";
3525
+ const AVAILABILITY_DOMAIN_PARAM$1 = "availabilityDomain";
3526
+ const PROHIBIT_PUBLIC_IP_PARAM = "prohibitPublicIpOnVnic";
3527
+ function buildId$11(id) {
3528
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3529
+ }
3530
+ function buildVersion$11(major, minor, patch) {
3531
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3532
+ }
3533
+ function buildOciSubnetType() {
3534
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_SUBNET_TYPE_NAME).build()).build();
3535
+ }
3536
+ function pushParam$9(params, key, value) {
3537
+ params.push(key, value);
3538
+ }
3539
+ let OciSubnet;
3540
+ (function(_OciSubnet) {
3541
+ const getBuilder = _OciSubnet.getBuilder = () => {
3542
+ const params = getParametersInstance();
3543
+ const inner = getLiveSystemComponentBuilder().withType(buildOciSubnetType()).withParameters(params).withProvider("OCI");
3544
+ const builder = {
3545
+ withId: (id) => {
3546
+ inner.withId(buildId$11(id));
3547
+ return builder;
3548
+ },
3549
+ withVersion: (major, minor, patch) => {
3550
+ inner.withVersion(buildVersion$11(major, minor, patch));
3551
+ return builder;
3552
+ },
3553
+ withDisplayName: (displayName) => {
3554
+ inner.withDisplayName(displayName);
3555
+ return builder;
3556
+ },
3557
+ withDescription: (description) => {
3558
+ inner.withDescription(description);
3559
+ return builder;
3560
+ },
3561
+ withCidrBlock: (value) => {
3562
+ pushParam$9(params, CIDR_BLOCK_PARAM, value);
3563
+ return builder;
3564
+ },
3565
+ withCompartmentId: (value) => {
3566
+ pushParam$9(params, COMPARTMENT_ID_PARAM$2, value);
3567
+ return builder;
3568
+ },
3569
+ withAvailabilityDomain: (value) => {
3570
+ pushParam$9(params, AVAILABILITY_DOMAIN_PARAM$1, value);
3571
+ return builder;
3572
+ },
3573
+ withProhibitPublicIpOnVnic: (value) => {
3574
+ pushParam$9(params, PROHIBIT_PUBLIC_IP_PARAM, value);
3575
+ return builder;
3576
+ },
3577
+ build: () => inner.build()
3578
+ };
3579
+ return builder;
3580
+ };
3581
+ _OciSubnet.satisfy = (blueprint) => {
3582
+ const params = getParametersInstance();
3583
+ const inner = getLiveSystemComponentBuilder().withType(buildOciSubnetType()).withParameters(params).withProvider("OCI").withId(buildId$11(blueprint.id.toString())).withVersion(buildVersion$11(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3584
+ if (blueprint.description) inner.withDescription(blueprint.description);
3585
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
3586
+ if (cidrBlock !== null) pushParam$9(params, CIDR_BLOCK_PARAM, String(cidrBlock));
3587
+ const satisfiedBuilder = {
3588
+ withCompartmentId: (value) => {
3589
+ pushParam$9(params, COMPARTMENT_ID_PARAM$2, value);
3590
+ return satisfiedBuilder;
3591
+ },
3592
+ withAvailabilityDomain: (value) => {
3593
+ pushParam$9(params, AVAILABILITY_DOMAIN_PARAM$1, value);
3594
+ return satisfiedBuilder;
3595
+ },
3596
+ withProhibitPublicIpOnVnic: (value) => {
3597
+ pushParam$9(params, PROHIBIT_PUBLIC_IP_PARAM, value);
3598
+ return satisfiedBuilder;
3599
+ },
3600
+ build: () => inner.build()
3601
+ };
3602
+ return satisfiedBuilder;
3603
+ };
3604
+ _OciSubnet.create = (config) => {
3605
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withCompartmentId(config.compartmentId);
3606
+ if (config.description) b.withDescription(config.description);
3607
+ if (config.availabilityDomain) b.withAvailabilityDomain(config.availabilityDomain);
3608
+ if (config.prohibitPublicIpOnVnic !== void 0) b.withProhibitPublicIpOnVnic(config.prohibitPublicIpOnVnic);
3609
+ return b.build();
3610
+ };
3611
+ })(OciSubnet || (OciSubnet = {}));
3612
+
3613
+ //#endregion
3614
+ //#region src/live_system/component/network_and_compute/iaas/oci_security_list.ts
3615
+ const OCI_SECURITY_LIST_TYPE_NAME = "OciSecurityList";
3616
+ const COMPARTMENT_ID_PARAM$1 = "compartmentId";
3617
+ function buildId$10(id) {
3618
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3619
+ }
3620
+ function buildVersion$10(major, minor, patch) {
3621
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3622
+ }
3623
+ function buildOciSecurityListType() {
3624
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_SECURITY_LIST_TYPE_NAME).build()).build();
3625
+ }
3626
+ function pushParam$8(params, key, value) {
3627
+ params.push(key, value);
3628
+ }
3629
+ let OciSecurityList;
3630
+ (function(_OciSecurityList) {
3631
+ const getBuilder = _OciSecurityList.getBuilder = () => {
3632
+ const params = getParametersInstance();
3633
+ const inner = getLiveSystemComponentBuilder().withType(buildOciSecurityListType()).withParameters(params).withProvider("OCI");
3634
+ const builder = {
3635
+ withId: (id) => {
3636
+ inner.withId(buildId$10(id));
3637
+ return builder;
3638
+ },
3639
+ withVersion: (major, minor, patch) => {
3640
+ inner.withVersion(buildVersion$10(major, minor, patch));
3641
+ return builder;
3642
+ },
3643
+ withDisplayName: (displayName) => {
3644
+ inner.withDisplayName(displayName);
3645
+ return builder;
3646
+ },
3647
+ withDescription: (description) => {
3648
+ inner.withDescription(description);
3649
+ pushParam$8(params, DESCRIPTION_PARAM, description);
3650
+ return builder;
3651
+ },
3652
+ withIngressRules: (rules) => {
3653
+ pushParam$8(params, INGRESS_RULES_PARAM, rules);
3654
+ return builder;
3655
+ },
3656
+ withCompartmentId: (value) => {
3657
+ pushParam$8(params, COMPARTMENT_ID_PARAM$1, value);
3658
+ return builder;
3659
+ },
3660
+ build: () => inner.build()
3661
+ };
3662
+ return builder;
3663
+ };
3664
+ _OciSecurityList.satisfy = (blueprint) => {
3665
+ const params = getParametersInstance();
3666
+ const inner = getLiveSystemComponentBuilder().withType(buildOciSecurityListType()).withParameters(params).withProvider("OCI").withId(buildId$10(blueprint.id.toString())).withVersion(buildVersion$10(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3667
+ const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
3668
+ if (description !== null) {
3669
+ inner.withDescription(String(description));
3670
+ pushParam$8(params, DESCRIPTION_PARAM, String(description));
3671
+ } else if (blueprint.description) inner.withDescription(blueprint.description);
3672
+ const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
3673
+ if (ingressRules !== null) pushParam$8(params, INGRESS_RULES_PARAM, ingressRules);
3674
+ const satisfiedBuilder = {
3675
+ withCompartmentId: (value) => {
3676
+ pushParam$8(params, COMPARTMENT_ID_PARAM$1, value);
3677
+ return satisfiedBuilder;
3678
+ },
3679
+ build: () => inner.build()
3680
+ };
3681
+ return satisfiedBuilder;
3682
+ };
3683
+ _OciSecurityList.create = (config) => {
3684
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCompartmentId(config.compartmentId);
3685
+ if (config.description) b.withDescription(config.description);
3686
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
3687
+ return b.build();
3688
+ };
3689
+ })(OciSecurityList || (OciSecurityList = {}));
3690
+
3691
+ //#endregion
3692
+ //#region src/live_system/component/network_and_compute/iaas/oci_instance.ts
3693
+ const OCI_INSTANCE_TYPE_NAME = "OciInstance";
3694
+ const COMPARTMENT_ID_PARAM = "compartmentId";
3695
+ const AVAILABILITY_DOMAIN_PARAM = "availabilityDomain";
3696
+ const SHAPE_PARAM = "shape";
3697
+ const IMAGE_ID_PARAM = "imageId";
3698
+ const OCPUS_PARAM = "ocpus";
3699
+ const MEMORY_IN_GBS_PARAM = "memoryInGbs";
3700
+ const SSH_PUBLIC_KEY_PARAM = "sshPublicKey";
3701
+ function buildId$9(id) {
3702
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3703
+ }
3704
+ function buildVersion$9(major, minor, patch) {
3705
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3706
+ }
3707
+ function buildOciInstanceType() {
3708
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_INSTANCE_TYPE_NAME).build()).build();
3709
+ }
3710
+ function pushParam$7(params, key, value) {
3711
+ params.push(key, value);
3712
+ }
3713
+ let OciInstance;
3714
+ (function(_OciInstance) {
3715
+ const getBuilder = _OciInstance.getBuilder = () => {
3716
+ const params = getParametersInstance();
3717
+ const inner = getLiveSystemComponentBuilder().withType(buildOciInstanceType()).withParameters(params).withProvider("OCI");
3718
+ const builder = {
3719
+ withId: (id) => {
3720
+ inner.withId(buildId$9(id));
3721
+ return builder;
3722
+ },
3723
+ withVersion: (major, minor, patch) => {
3724
+ inner.withVersion(buildVersion$9(major, minor, patch));
3725
+ return builder;
3726
+ },
3727
+ withDisplayName: (displayName) => {
3728
+ inner.withDisplayName(displayName);
3729
+ return builder;
3730
+ },
3731
+ withDescription: (description) => {
3732
+ inner.withDescription(description);
3733
+ return builder;
3734
+ },
3735
+ withCompartmentId: (value) => {
3736
+ pushParam$7(params, COMPARTMENT_ID_PARAM, value);
3737
+ return builder;
3738
+ },
3739
+ withAvailabilityDomain: (value) => {
3740
+ pushParam$7(params, AVAILABILITY_DOMAIN_PARAM, value);
3741
+ return builder;
3742
+ },
3743
+ withShape: (value) => {
3744
+ pushParam$7(params, SHAPE_PARAM, value);
3745
+ return builder;
3746
+ },
3747
+ withImageId: (value) => {
3748
+ pushParam$7(params, IMAGE_ID_PARAM, value);
3749
+ return builder;
3750
+ },
3751
+ withOcpus: (value) => {
3752
+ pushParam$7(params, OCPUS_PARAM, value);
3753
+ return builder;
3754
+ },
3755
+ withMemoryInGbs: (value) => {
3756
+ pushParam$7(params, MEMORY_IN_GBS_PARAM, value);
3757
+ return builder;
3758
+ },
3759
+ withSshPublicKey: (value) => {
3760
+ pushParam$7(params, SSH_PUBLIC_KEY_PARAM, value);
3761
+ return builder;
3762
+ },
3763
+ build: () => inner.build()
3764
+ };
3765
+ return builder;
3766
+ };
3767
+ _OciInstance.satisfy = (blueprint) => {
3768
+ const params = getParametersInstance();
3769
+ const inner = getLiveSystemComponentBuilder().withType(buildOciInstanceType()).withParameters(params).withProvider("OCI").withId(buildId$9(blueprint.id.toString())).withVersion(buildVersion$9(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3770
+ if (blueprint.description) inner.withDescription(blueprint.description);
3771
+ const satisfiedBuilder = {
3772
+ withCompartmentId: (value) => {
3773
+ pushParam$7(params, COMPARTMENT_ID_PARAM, value);
3774
+ return satisfiedBuilder;
3775
+ },
3776
+ withAvailabilityDomain: (value) => {
3777
+ pushParam$7(params, AVAILABILITY_DOMAIN_PARAM, value);
3778
+ return satisfiedBuilder;
3779
+ },
3780
+ withShape: (value) => {
3781
+ pushParam$7(params, SHAPE_PARAM, value);
3782
+ return satisfiedBuilder;
3783
+ },
3784
+ withImageId: (value) => {
3785
+ pushParam$7(params, IMAGE_ID_PARAM, value);
3786
+ return satisfiedBuilder;
3787
+ },
3788
+ withOcpus: (value) => {
3789
+ pushParam$7(params, OCPUS_PARAM, value);
3790
+ return satisfiedBuilder;
3791
+ },
3792
+ withMemoryInGbs: (value) => {
3793
+ pushParam$7(params, MEMORY_IN_GBS_PARAM, value);
3794
+ return satisfiedBuilder;
3795
+ },
3796
+ withSshPublicKey: (value) => {
3797
+ pushParam$7(params, SSH_PUBLIC_KEY_PARAM, value);
3798
+ return satisfiedBuilder;
3799
+ },
3800
+ build: () => inner.build()
3801
+ };
3802
+ return satisfiedBuilder;
3803
+ };
3804
+ _OciInstance.create = (config) => {
3805
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCompartmentId(config.compartmentId).withAvailabilityDomain(config.availabilityDomain).withShape(config.shape).withImageId(config.imageId);
3806
+ if (config.description) b.withDescription(config.description);
3807
+ if (config.ocpus !== void 0) b.withOcpus(config.ocpus);
3808
+ if (config.memoryInGbs !== void 0) b.withMemoryInGbs(config.memoryInGbs);
3809
+ if (config.sshPublicKey) b.withSshPublicKey(config.sshPublicKey);
3810
+ return b.build();
3811
+ };
3812
+ })(OciInstance || (OciInstance = {}));
3813
+
3814
+ //#endregion
3815
+ //#region src/live_system/component/network_and_compute/iaas/hetzner_network.ts
3816
+ const HETZNER_NETWORK_TYPE_NAME = "HetznerNetwork";
3817
+ function buildId$8(id) {
3818
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3819
+ }
3820
+ function buildVersion$8(major, minor, patch) {
3821
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3822
+ }
3823
+ function buildHetznerNetworkType() {
3824
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_NETWORK_TYPE_NAME).build()).build();
3825
+ }
3826
+ function pushParam$6(params, key, value) {
3827
+ params.push(key, value);
3828
+ }
3829
+ let HetznerNetwork;
3830
+ (function(_HetznerNetwork) {
3831
+ const getBuilder = _HetznerNetwork.getBuilder = () => {
3832
+ const params = getParametersInstance();
3833
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerNetworkType()).withParameters(params).withProvider("Hetzner");
3834
+ const builder = {
3835
+ withId: (id) => {
3836
+ inner.withId(buildId$8(id));
3837
+ return builder;
3838
+ },
3839
+ withVersion: (major, minor, patch) => {
3840
+ inner.withVersion(buildVersion$8(major, minor, patch));
3841
+ return builder;
3842
+ },
3843
+ withDisplayName: (displayName) => {
3844
+ inner.withDisplayName(displayName);
3845
+ return builder;
3846
+ },
3847
+ withDescription: (description) => {
3848
+ inner.withDescription(description);
3849
+ return builder;
3850
+ },
3851
+ withCidrBlock: (value) => {
3852
+ pushParam$6(params, CIDR_BLOCK_PARAM$1, value);
3853
+ return builder;
3854
+ },
3855
+ build: () => inner.build()
3856
+ };
3857
+ return builder;
3858
+ };
3859
+ _HetznerNetwork.satisfy = (blueprint) => {
3860
+ const params = getParametersInstance();
3861
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerNetworkType()).withParameters(params).withProvider("Hetzner").withId(buildId$8(blueprint.id.toString())).withVersion(buildVersion$8(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3862
+ if (blueprint.description) inner.withDescription(blueprint.description);
3863
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
3864
+ if (cidrBlock !== null) pushParam$6(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
3865
+ return { build: () => inner.build() };
3866
+ };
3867
+ _HetznerNetwork.create = (config) => {
3868
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock);
3869
+ if (config.description) b.withDescription(config.description);
3870
+ return b.build();
3871
+ };
3872
+ })(HetznerNetwork || (HetznerNetwork = {}));
3873
+
3874
+ //#endregion
3875
+ //#region src/live_system/component/network_and_compute/iaas/hetzner_subnet.ts
3876
+ const HETZNER_SUBNET_TYPE_NAME = "HetznerSubnet";
3877
+ const NETWORK_ZONE_PARAM = "networkZone";
3878
+ const TYPE_PARAM = "type";
3879
+ function buildId$7(id) {
3880
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3881
+ }
3882
+ function buildVersion$7(major, minor, patch) {
3883
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3884
+ }
3885
+ function buildHetznerSubnetType() {
3886
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_SUBNET_TYPE_NAME).build()).build();
3887
+ }
3888
+ function pushParam$5(params, key, value) {
3889
+ params.push(key, value);
3890
+ }
3891
+ let HetznerSubnet;
3892
+ (function(_HetznerSubnet) {
3893
+ const getBuilder = _HetznerSubnet.getBuilder = () => {
3894
+ const params = getParametersInstance();
3895
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerSubnetType()).withParameters(params).withProvider("Hetzner");
3896
+ const builder = {
3897
+ withId: (id) => {
3898
+ inner.withId(buildId$7(id));
3899
+ return builder;
3900
+ },
3901
+ withVersion: (major, minor, patch) => {
3902
+ inner.withVersion(buildVersion$7(major, minor, patch));
3903
+ return builder;
3904
+ },
3905
+ withDisplayName: (displayName) => {
3906
+ inner.withDisplayName(displayName);
3907
+ return builder;
3908
+ },
3909
+ withDescription: (description) => {
3910
+ inner.withDescription(description);
3911
+ return builder;
3912
+ },
3913
+ withCidrBlock: (value) => {
3914
+ pushParam$5(params, CIDR_BLOCK_PARAM, value);
3915
+ return builder;
3916
+ },
3917
+ withNetworkZone: (value) => {
3918
+ pushParam$5(params, NETWORK_ZONE_PARAM, value);
3919
+ return builder;
3920
+ },
3921
+ withType: (value) => {
3922
+ pushParam$5(params, TYPE_PARAM, value);
3923
+ return builder;
3924
+ },
3925
+ build: () => inner.build()
3926
+ };
3927
+ return builder;
3928
+ };
3929
+ _HetznerSubnet.satisfy = (blueprint) => {
3930
+ const params = getParametersInstance();
3931
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerSubnetType()).withParameters(params).withProvider("Hetzner").withId(buildId$7(blueprint.id.toString())).withVersion(buildVersion$7(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
3932
+ if (blueprint.description) inner.withDescription(blueprint.description);
3933
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
3934
+ if (cidrBlock !== null) pushParam$5(params, CIDR_BLOCK_PARAM, String(cidrBlock));
3935
+ const satisfiedBuilder = {
3936
+ withNetworkZone: (value) => {
3937
+ pushParam$5(params, NETWORK_ZONE_PARAM, value);
3938
+ return satisfiedBuilder;
3939
+ },
3940
+ withType: (value) => {
3941
+ pushParam$5(params, TYPE_PARAM, value);
3942
+ return satisfiedBuilder;
3943
+ },
3944
+ build: () => inner.build()
3945
+ };
3946
+ return satisfiedBuilder;
3947
+ };
3948
+ _HetznerSubnet.create = (config) => {
3949
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withNetworkZone(config.networkZone);
3950
+ if (config.description) b.withDescription(config.description);
3951
+ if (config.type) b.withType(config.type);
3952
+ return b.build();
3953
+ };
3954
+ })(HetznerSubnet || (HetznerSubnet = {}));
3955
+
3956
+ //#endregion
3957
+ //#region src/live_system/component/network_and_compute/iaas/hetzner_firewall.ts
3958
+ const HETZNER_FIREWALL_TYPE_NAME = "HetznerFirewall";
3959
+ function buildId$6(id) {
3960
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3961
+ }
3962
+ function buildVersion$6(major, minor, patch) {
3963
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3964
+ }
3965
+ function buildHetznerFirewallType() {
3966
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_FIREWALL_TYPE_NAME).build()).build();
3967
+ }
3968
+ function pushParam$4(params, key, value) {
3969
+ params.push(key, value);
3970
+ }
3971
+ let HetznerFirewall;
3972
+ (function(_HetznerFirewall) {
3973
+ const getBuilder = _HetznerFirewall.getBuilder = () => {
3974
+ const params = getParametersInstance();
3975
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerFirewallType()).withParameters(params).withProvider("Hetzner");
3976
+ const builder = {
3977
+ withId: (id) => {
3978
+ inner.withId(buildId$6(id));
3979
+ return builder;
3980
+ },
3981
+ withVersion: (major, minor, patch) => {
3982
+ inner.withVersion(buildVersion$6(major, minor, patch));
3983
+ return builder;
3984
+ },
3985
+ withDisplayName: (displayName) => {
3986
+ inner.withDisplayName(displayName);
3987
+ return builder;
3988
+ },
3989
+ withDescription: (description) => {
3990
+ inner.withDescription(description);
3991
+ pushParam$4(params, DESCRIPTION_PARAM, description);
3992
+ return builder;
3993
+ },
3994
+ withIngressRules: (rules) => {
3995
+ pushParam$4(params, INGRESS_RULES_PARAM, rules);
3996
+ return builder;
3997
+ },
3998
+ build: () => inner.build()
3999
+ };
4000
+ return builder;
4001
+ };
4002
+ _HetznerFirewall.satisfy = (blueprint) => {
4003
+ const params = getParametersInstance();
4004
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerFirewallType()).withParameters(params).withProvider("Hetzner").withId(buildId$6(blueprint.id.toString())).withVersion(buildVersion$6(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
4005
+ const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
4006
+ if (description !== null) {
4007
+ inner.withDescription(String(description));
4008
+ pushParam$4(params, DESCRIPTION_PARAM, String(description));
4009
+ } else if (blueprint.description) inner.withDescription(blueprint.description);
4010
+ const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
4011
+ if (ingressRules !== null) pushParam$4(params, INGRESS_RULES_PARAM, ingressRules);
4012
+ return { build: () => inner.build() };
4013
+ };
4014
+ _HetznerFirewall.create = (config) => {
4015
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
4016
+ if (config.description) b.withDescription(config.description);
4017
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
4018
+ return b.build();
4019
+ };
4020
+ })(HetznerFirewall || (HetznerFirewall = {}));
4021
+
4022
+ //#endregion
4023
+ //#region src/live_system/component/network_and_compute/iaas/hetzner_server.ts
4024
+ const HETZNER_SERVER_TYPE_NAME = "HetznerServer";
4025
+ const SERVER_TYPE_PARAM = "serverType";
4026
+ const LOCATION_PARAM = "location";
4027
+ const IMAGE_PARAM = "image";
4028
+ const SSH_KEYS_PARAM = "sshKeys";
4029
+ const USER_DATA_PARAM = "userData";
4030
+ function buildId$5(id) {
4031
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4032
+ }
4033
+ function buildVersion$5(major, minor, patch) {
4034
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4035
+ }
4036
+ function buildHetznerServerType() {
4037
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_SERVER_TYPE_NAME).build()).build();
4038
+ }
4039
+ function pushParam$3(params, key, value) {
4040
+ params.push(key, value);
4041
+ }
4042
+ let HetznerServer;
4043
+ (function(_HetznerServer) {
4044
+ const getBuilder = _HetznerServer.getBuilder = () => {
4045
+ const params = getParametersInstance();
4046
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerServerType()).withParameters(params).withProvider("Hetzner");
4047
+ const builder = {
4048
+ withId: (id) => {
4049
+ inner.withId(buildId$5(id));
4050
+ return builder;
4051
+ },
4052
+ withVersion: (major, minor, patch) => {
4053
+ inner.withVersion(buildVersion$5(major, minor, patch));
4054
+ return builder;
4055
+ },
4056
+ withDisplayName: (displayName) => {
4057
+ inner.withDisplayName(displayName);
4058
+ return builder;
4059
+ },
4060
+ withDescription: (description) => {
4061
+ inner.withDescription(description);
4062
+ return builder;
4063
+ },
4064
+ withServerType: (value) => {
4065
+ pushParam$3(params, SERVER_TYPE_PARAM, value);
4066
+ return builder;
4067
+ },
4068
+ withLocation: (value) => {
4069
+ pushParam$3(params, LOCATION_PARAM, value);
4070
+ return builder;
4071
+ },
4072
+ withImage: (value) => {
4073
+ pushParam$3(params, IMAGE_PARAM, value);
4074
+ return builder;
4075
+ },
4076
+ withSshKeys: (value) => {
4077
+ pushParam$3(params, SSH_KEYS_PARAM, value);
4078
+ return builder;
4079
+ },
4080
+ withUserData: (value) => {
4081
+ pushParam$3(params, USER_DATA_PARAM, value);
4082
+ return builder;
4083
+ },
4084
+ build: () => inner.build()
4085
+ };
4086
+ return builder;
4087
+ };
4088
+ _HetznerServer.satisfy = (blueprint) => {
4089
+ const params = getParametersInstance();
4090
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerServerType()).withParameters(params).withProvider("Hetzner").withId(buildId$5(blueprint.id.toString())).withVersion(buildVersion$5(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
4091
+ if (blueprint.description) inner.withDescription(blueprint.description);
4092
+ const satisfiedBuilder = {
4093
+ withServerType: (value) => {
4094
+ pushParam$3(params, SERVER_TYPE_PARAM, value);
4095
+ return satisfiedBuilder;
4096
+ },
4097
+ withLocation: (value) => {
4098
+ pushParam$3(params, LOCATION_PARAM, value);
4099
+ return satisfiedBuilder;
4100
+ },
4101
+ withImage: (value) => {
4102
+ pushParam$3(params, IMAGE_PARAM, value);
4103
+ return satisfiedBuilder;
4104
+ },
4105
+ withSshKeys: (value) => {
4106
+ pushParam$3(params, SSH_KEYS_PARAM, value);
4107
+ return satisfiedBuilder;
4108
+ },
4109
+ withUserData: (value) => {
4110
+ pushParam$3(params, USER_DATA_PARAM, value);
4111
+ return satisfiedBuilder;
4112
+ },
4113
+ build: () => inner.build()
4114
+ };
4115
+ return satisfiedBuilder;
4116
+ };
4117
+ _HetznerServer.create = (config) => {
4118
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withServerType(config.serverType).withLocation(config.location).withImage(config.image);
4119
+ if (config.description) b.withDescription(config.description);
4120
+ if (config.sshKeys && config.sshKeys.length > 0) b.withSshKeys(config.sshKeys);
4121
+ if (config.userData) b.withUserData(config.userData);
4122
+ return b.build();
4123
+ };
4124
+ })(HetznerServer || (HetznerServer = {}));
4125
+
4126
+ //#endregion
4127
+ //#region src/fractal/component/network_and_compute/paas/container_platform.ts
4128
+ const CONTAINER_PLATFORM_TYPE_NAME = "ContainerPlatform";
4129
+ function buildId$4(id) {
4130
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4131
+ }
4132
+ function buildVersion$4(major, minor, patch) {
4133
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4134
+ }
4135
+ function buildContainerPlatformType() {
4136
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(CONTAINER_PLATFORM_TYPE_NAME).build()).build();
4137
+ }
4138
+ function makeContainerPlatformNode(platform, workloadNodes) {
4139
+ const platformDep = { id: platform.id };
4140
+ return {
4141
+ platform,
4142
+ workloads: workloadNodes.map((w) => ({
4143
+ ...w,
4144
+ component: {
4145
+ ...w.component,
4146
+ dependencies: [...w.component.dependencies, platformDep]
4147
+ }
4148
+ })),
4149
+ withWorkloads: (newWorkloads) => makeContainerPlatformNode(platform, newWorkloads)
4150
+ };
4151
+ }
4152
+ let ContainerPlatform;
4153
+ (function(_ContainerPlatform) {
4154
+ const getBuilder = _ContainerPlatform.getBuilder = () => {
4155
+ const params = getParametersInstance();
4156
+ const inner = getBlueprintComponentBuilder().withType(buildContainerPlatformType()).withParameters(params);
4157
+ const builder = {
4158
+ withId: (id) => {
4159
+ inner.withId(buildId$4(id));
4160
+ return builder;
4161
+ },
4162
+ withVersion: (major, minor, patch) => {
4163
+ inner.withVersion(buildVersion$4(major, minor, patch));
4164
+ return builder;
4165
+ },
4166
+ withDisplayName: (displayName) => {
4167
+ inner.withDisplayName(displayName);
4168
+ return builder;
4169
+ },
4170
+ withDescription: (description) => {
4171
+ inner.withDescription(description);
4172
+ return builder;
4173
+ },
4174
+ build: () => inner.build()
4175
+ };
4176
+ return builder;
4177
+ };
4178
+ _ContainerPlatform.create = (config) => {
4179
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
4180
+ if (config.description) b.withDescription(config.description);
4181
+ return makeContainerPlatformNode(b.build(), []);
4182
+ };
4183
+ })(ContainerPlatform || (ContainerPlatform = {}));
4184
+
4185
+ //#endregion
4186
+ //#region src/fractal/component/custom_workloads/caas/workload.ts
4187
+ const WORKLOAD_TYPE_NAME = "Workload";
4188
+ const CONTAINER_IMAGE_PARAM = "containerImage";
4189
+ const CONTAINER_PORT_PARAM = "containerPort";
4190
+ const CONTAINER_NAME_PARAM = "containerName";
4191
+ const CPU_PARAM = "cpu";
4192
+ const MEMORY_PARAM = "memory";
4193
+ const DESIRED_COUNT_PARAM = "desiredCount";
4194
+ function buildId$3(id) {
4195
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4196
+ }
4197
+ function buildVersion$3(major, minor, patch) {
4198
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4199
+ }
4200
+ function buildWorkloadType() {
4201
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.CustomWorkloads).withServiceDeliveryModel(ServiceDeliveryModel$1.CaaS).withName(PascalCaseString$1.getBuilder().withValue(WORKLOAD_TYPE_NAME).build()).build();
4202
+ }
4203
+ function pushParam$2(params, key, value) {
4204
+ params.push(key, value);
4205
+ }
4206
+ function buildLinkParams(fromPort, toPort, protocol) {
4207
+ const p = getParametersInstance();
4208
+ p.push("fromPort", fromPort);
4209
+ if (toPort !== void 0) p.push("toPort", toPort);
4210
+ if (protocol) p.push("protocol", protocol);
4211
+ return p;
4212
+ }
4213
+ function makeWorkloadNode(component) {
4214
+ return {
4215
+ component,
4216
+ components: [component],
4217
+ withLinks: (links) => {
4218
+ const portLinks = links.map((l) => getLinkBuilder().withId(l.target.component.id).withType(buildWorkloadType()).withParameters(buildLinkParams(l.fromPort, l.toPort, l.protocol)).build());
4219
+ return makeWorkloadNode({
4220
+ ...component,
4221
+ links: [...component.links, ...portLinks]
4222
+ });
4223
+ },
4224
+ withSecurityGroups: (sgs) => {
4225
+ const sgLinks = sgs.map((sg) => getLinkBuilder().withId(sg.id).withType(sg.type).withParameters(getParametersInstance()).build());
4226
+ return makeWorkloadNode({
4227
+ ...component,
4228
+ links: [...component.links, ...sgLinks]
4229
+ });
4230
+ }
4231
+ };
4232
+ }
4233
+ let Workload;
4234
+ (function(_Workload) {
4235
+ const getBuilder = _Workload.getBuilder = () => {
4236
+ const params = getParametersInstance();
4237
+ const inner = getBlueprintComponentBuilder().withType(buildWorkloadType()).withParameters(params);
4238
+ const builder = {
4239
+ withId: (id) => {
4240
+ inner.withId(buildId$3(id));
4241
+ return builder;
4242
+ },
4243
+ withVersion: (major, minor, patch) => {
4244
+ inner.withVersion(buildVersion$3(major, minor, patch));
4245
+ return builder;
4246
+ },
4247
+ withDisplayName: (displayName) => {
4248
+ inner.withDisplayName(displayName);
4249
+ return builder;
4250
+ },
4251
+ withDescription: (description) => {
4252
+ inner.withDescription(description);
4253
+ return builder;
4254
+ },
4255
+ withContainerImage: (image) => {
4256
+ pushParam$2(params, CONTAINER_IMAGE_PARAM, image);
4257
+ return builder;
4258
+ },
4259
+ withContainerPort: (port) => {
4260
+ pushParam$2(params, CONTAINER_PORT_PARAM, port);
4261
+ return builder;
4262
+ },
4263
+ withContainerName: (name) => {
4264
+ pushParam$2(params, CONTAINER_NAME_PARAM, name);
4265
+ return builder;
4266
+ },
4267
+ withCpu: (cpu) => {
4268
+ pushParam$2(params, CPU_PARAM, cpu);
4269
+ return builder;
4270
+ },
4271
+ withMemory: (memory) => {
4272
+ pushParam$2(params, MEMORY_PARAM, memory);
4273
+ return builder;
4274
+ },
4275
+ withDesiredCount: (count) => {
4276
+ pushParam$2(params, DESIRED_COUNT_PARAM, count);
4277
+ return builder;
4278
+ },
4279
+ build: () => inner.build()
4280
+ };
4281
+ return builder;
4282
+ };
4283
+ _Workload.create = (config) => {
4284
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withContainerImage(config.containerImage);
4285
+ if (config.description) b.withDescription(config.description);
4286
+ if (config.containerPort !== void 0) b.withContainerPort(config.containerPort);
4287
+ if (config.containerName) b.withContainerName(config.containerName);
4288
+ if (config.cpu) b.withCpu(config.cpu);
4289
+ if (config.memory) b.withMemory(config.memory);
4290
+ if (config.desiredCount !== void 0) b.withDesiredCount(config.desiredCount);
4291
+ return makeWorkloadNode(b.build());
4292
+ };
4293
+ })(Workload || (Workload = {}));
4294
+
4295
+ //#endregion
4296
+ //#region src/live_system/component/network_and_compute/paas/ecs_cluster.ts
4297
+ const ECS_CLUSTER_TYPE_NAME = "ECS";
4298
+ function buildId$2(id) {
4299
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4300
+ }
4301
+ function buildVersion$2(major, minor, patch) {
4302
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4303
+ }
4304
+ function buildAwsEcsClusterType() {
4305
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(ECS_CLUSTER_TYPE_NAME).build()).build();
4306
+ }
4307
+ let AwsEcsCluster;
4308
+ (function(_AwsEcsCluster) {
4309
+ const getBuilder = _AwsEcsCluster.getBuilder = () => {
4310
+ const params = getParametersInstance();
4311
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsClusterType()).withParameters(params).withProvider("AWS");
4312
+ const builder = {
4313
+ withId: (id) => {
4314
+ inner.withId(buildId$2(id));
4315
+ return builder;
4316
+ },
4317
+ withVersion: (major, minor, patch) => {
4318
+ inner.withVersion(buildVersion$2(major, minor, patch));
4319
+ return builder;
4320
+ },
4321
+ withDisplayName: (displayName) => {
4322
+ inner.withDisplayName(displayName);
4323
+ return builder;
4324
+ },
4325
+ withDescription: (description) => {
4326
+ inner.withDescription(description);
4327
+ return builder;
4328
+ },
4329
+ build: () => inner.build()
4330
+ };
4331
+ return builder;
4332
+ };
4333
+ _AwsEcsCluster.satisfy = (platform) => {
4334
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsClusterType()).withParameters(getParametersInstance()).withProvider("AWS").withId(buildId$2(platform.id.toString())).withVersion(buildVersion$2(platform.version.major, platform.version.minor, platform.version.patch)).withDisplayName(platform.displayName);
4335
+ if (platform.description) inner.withDescription(platform.description);
4336
+ return { build: () => inner.build() };
4337
+ };
4338
+ _AwsEcsCluster.create = (config) => {
4339
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
4340
+ if (config.description) b.withDescription(config.description);
4341
+ return b.build();
4342
+ };
4343
+ })(AwsEcsCluster || (AwsEcsCluster = {}));
4344
+
4345
+ //#endregion
4346
+ //#region src/live_system/component/network_and_compute/paas/ecs_task_definition.ts
4347
+ const ECS_TASK_DEF_TYPE_NAME = "ECSTaskDefinition";
4348
+ const NETWORK_MODE_PARAM = "networkMode";
4349
+ const EXECUTION_ROLE_ARN_PARAM = "executionRoleArn";
4350
+ const TASK_ROLE_ARN_PARAM = "taskRoleArn";
4351
+ function buildId$1(id) {
4352
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4353
+ }
4354
+ function buildVersion$1(major, minor, patch) {
4355
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4356
+ }
4357
+ function buildAwsEcsTaskDefType() {
4358
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(ECS_TASK_DEF_TYPE_NAME).build()).build();
4359
+ }
4360
+ function pushParam$1(params, key, value) {
4361
+ params.push(key, value);
4362
+ }
4363
+ let AwsEcsTaskDefinition;
4364
+ (function(_AwsEcsTaskDefinition) {
4365
+ const getBuilder = _AwsEcsTaskDefinition.getBuilder = () => {
4366
+ const params = getParametersInstance();
4367
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsTaskDefType()).withParameters(params).withProvider("AWS");
4368
+ const builder = {
4369
+ withId: (id) => {
4370
+ inner.withId(buildId$1(id));
4371
+ return builder;
4372
+ },
4373
+ withVersion: (major, minor, patch) => {
4374
+ inner.withVersion(buildVersion$1(major, minor, patch));
4375
+ return builder;
4376
+ },
4377
+ withDisplayName: (displayName) => {
4378
+ inner.withDisplayName(displayName);
4379
+ return builder;
4380
+ },
4381
+ withDescription: (description) => {
4382
+ inner.withDescription(description);
4383
+ return builder;
4384
+ },
4385
+ withContainerImage: (image) => {
4386
+ pushParam$1(params, CONTAINER_IMAGE_PARAM, image);
4387
+ return builder;
4388
+ },
4389
+ withContainerPort: (port) => {
4390
+ pushParam$1(params, CONTAINER_PORT_PARAM, port);
4391
+ return builder;
4392
+ },
4393
+ withContainerName: (name) => {
4394
+ pushParam$1(params, CONTAINER_NAME_PARAM, name);
4395
+ return builder;
4396
+ },
4397
+ withCpu: (cpu) => {
4398
+ pushParam$1(params, CPU_PARAM, cpu);
4399
+ return builder;
4400
+ },
4401
+ withMemory: (memory) => {
4402
+ pushParam$1(params, MEMORY_PARAM, memory);
4403
+ return builder;
4404
+ },
4405
+ withNetworkMode: (mode) => {
4406
+ pushParam$1(params, NETWORK_MODE_PARAM, mode);
4407
+ return builder;
4408
+ },
4409
+ withExecutionRoleArn: (arn) => {
4410
+ pushParam$1(params, EXECUTION_ROLE_ARN_PARAM, arn);
4411
+ return builder;
4412
+ },
4413
+ withTaskRoleArn: (arn) => {
4414
+ pushParam$1(params, TASK_ROLE_ARN_PARAM, arn);
4415
+ return builder;
4416
+ },
4417
+ build: () => inner.build()
4418
+ };
4419
+ return builder;
4420
+ };
4421
+ _AwsEcsTaskDefinition.satisfy = (workload) => {
4422
+ const params = getParametersInstance();
4423
+ const taskId = `${workload.id.toString()}-task`;
4424
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsTaskDefType()).withParameters(params).withProvider("AWS").withId(buildId$1(taskId)).withVersion(buildVersion$1(workload.version.major, workload.version.minor, workload.version.patch)).withDisplayName(workload.displayName);
4425
+ if (workload.description) inner.withDescription(workload.description);
4426
+ for (const key of [
4427
+ CONTAINER_IMAGE_PARAM,
4428
+ CONTAINER_PORT_PARAM,
4429
+ CONTAINER_NAME_PARAM,
4430
+ CPU_PARAM,
4431
+ MEMORY_PARAM
4432
+ ]) {
4433
+ const v = workload.parameters.getOptionalFieldByName(key);
4434
+ if (v !== null) pushParam$1(params, key, v);
4435
+ }
4436
+ const satisfiedBuilder = {
4437
+ withNetworkMode: (mode) => {
4438
+ pushParam$1(params, NETWORK_MODE_PARAM, mode);
4439
+ return satisfiedBuilder;
4440
+ },
4441
+ withExecutionRoleArn: (arn) => {
4442
+ pushParam$1(params, EXECUTION_ROLE_ARN_PARAM, arn);
4443
+ return satisfiedBuilder;
4444
+ },
4445
+ withTaskRoleArn: (arn) => {
4446
+ pushParam$1(params, TASK_ROLE_ARN_PARAM, arn);
4447
+ return satisfiedBuilder;
4448
+ },
4449
+ build: () => inner.build()
4450
+ };
4451
+ return satisfiedBuilder;
4452
+ };
4453
+ _AwsEcsTaskDefinition.create = (config) => {
4454
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withContainerImage(config.containerImage);
4455
+ if (config.description) b.withDescription(config.description);
4456
+ if (config.containerPort !== void 0) b.withContainerPort(config.containerPort);
4457
+ if (config.containerName) b.withContainerName(config.containerName);
4458
+ if (config.cpu) b.withCpu(config.cpu);
4459
+ if (config.memory) b.withMemory(config.memory);
4460
+ if (config.networkMode) b.withNetworkMode(config.networkMode);
4461
+ if (config.executionRoleArn) b.withExecutionRoleArn(config.executionRoleArn);
4462
+ if (config.taskRoleArn) b.withTaskRoleArn(config.taskRoleArn);
4463
+ return b.build();
4464
+ };
4465
+ })(AwsEcsTaskDefinition || (AwsEcsTaskDefinition = {}));
4466
+
4467
+ //#endregion
4468
+ //#region src/live_system/component/network_and_compute/paas/ecs_service.ts
4469
+ const ECS_SERVICE_TYPE_NAME = "ECSService";
4470
+ const LAUNCH_TYPE_PARAM = "launchType";
4471
+ const ASSIGN_PUBLIC_IP_PARAM = "assignPublicIp";
4472
+ function buildId(id) {
4473
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4474
+ }
4475
+ function buildVersion(major, minor, patch) {
4476
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4477
+ }
4478
+ function buildAwsEcsServiceType() {
4479
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(ECS_SERVICE_TYPE_NAME).build()).build();
4480
+ }
4481
+ function pushParam(params, key, value) {
4482
+ params.push(key, value);
4483
+ }
4484
+ let AwsEcsService;
4485
+ (function(_AwsEcsService) {
4486
+ const getBuilder = _AwsEcsService.getBuilder = () => {
4487
+ const params = getParametersInstance();
4488
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsServiceType()).withParameters(params).withProvider("AWS");
4489
+ const builder = {
4490
+ withId: (id) => {
4491
+ inner.withId(buildId(id));
4492
+ return builder;
4493
+ },
4494
+ withVersion: (major, minor, patch) => {
4495
+ inner.withVersion(buildVersion(major, minor, patch));
4496
+ return builder;
4497
+ },
4498
+ withDisplayName: (displayName) => {
4499
+ inner.withDisplayName(displayName);
4500
+ return builder;
4501
+ },
4502
+ withDescription: (description) => {
4503
+ inner.withDescription(description);
4504
+ return builder;
4505
+ },
4506
+ withDesiredCount: (count) => {
4507
+ pushParam(params, DESIRED_COUNT_PARAM, count);
4508
+ return builder;
4509
+ },
4510
+ withLaunchType: (type) => {
4511
+ pushParam(params, LAUNCH_TYPE_PARAM, type);
4512
+ return builder;
4513
+ },
4514
+ withAssignPublicIp: (assign) => {
4515
+ pushParam(params, ASSIGN_PUBLIC_IP_PARAM, assign);
4516
+ return builder;
4517
+ },
4518
+ build: () => inner.build()
4519
+ };
4520
+ return builder;
4521
+ };
4522
+ _AwsEcsService.satisfy = (workload) => {
4523
+ const params = getParametersInstance();
4524
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsServiceType()).withParameters(params).withProvider("AWS").withId(buildId(workload.id.toString())).withVersion(buildVersion(workload.version.major, workload.version.minor, workload.version.patch)).withDisplayName(workload.displayName).withDependencies(workload.dependencies).withLinks(workload.links);
4525
+ if (workload.description) inner.withDescription(workload.description);
4526
+ const desiredCount = workload.parameters.getOptionalFieldByName(DESIRED_COUNT_PARAM);
4527
+ if (desiredCount !== null) pushParam(params, DESIRED_COUNT_PARAM, desiredCount);
4528
+ const satisfiedBuilder = {
4529
+ withLaunchType: (type) => {
4530
+ pushParam(params, LAUNCH_TYPE_PARAM, type);
4531
+ return satisfiedBuilder;
4532
+ },
4533
+ withAssignPublicIp: (assign) => {
4534
+ pushParam(params, ASSIGN_PUBLIC_IP_PARAM, assign);
4535
+ return satisfiedBuilder;
4536
+ },
4537
+ build: () => inner.build()
4538
+ };
4539
+ return satisfiedBuilder;
4540
+ };
4541
+ _AwsEcsService.create = (config) => {
4542
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
4543
+ if (config.description) b.withDescription(config.description);
4544
+ if (config.desiredCount !== void 0) b.withDesiredCount(config.desiredCount);
4545
+ if (config.launchType) b.withLaunchType(config.launchType);
4546
+ if (config.assignPublicIp !== void 0) b.withAssignPublicIp(config.assignPublicIp);
4547
+ return b.build();
4548
+ };
4549
+ })(AwsEcsService || (AwsEcsService = {}));
4550
+
1468
4551
  //#endregion
1469
4552
  //#region src/index.ts
1470
4553
  const BoundedContext = BoundedContext$1;
@@ -1478,16 +4561,194 @@ const ServiceAccountCredentials = ServiceAccountCredentials$1;
1478
4561
  const ServiceAccountId = ServiceAccountId$1;
1479
4562
  const ServiceDeliveryModel = ServiceDeliveryModel$1;
1480
4563
  const Version = Version$1;
4564
+ const Environment = Environment$1;
4565
+ const LiveSystem = LiveSystem$1;
1481
4566
 
1482
4567
  //#endregion
4568
+ Object.defineProperty(exports, 'AwsEcsCluster', {
4569
+ enumerable: true,
4570
+ get: function () {
4571
+ return AwsEcsCluster;
4572
+ }
4573
+ });
4574
+ Object.defineProperty(exports, 'AwsEcsService', {
4575
+ enumerable: true,
4576
+ get: function () {
4577
+ return AwsEcsService;
4578
+ }
4579
+ });
4580
+ Object.defineProperty(exports, 'AwsEcsTaskDefinition', {
4581
+ enumerable: true,
4582
+ get: function () {
4583
+ return AwsEcsTaskDefinition;
4584
+ }
4585
+ });
4586
+ Object.defineProperty(exports, 'AwsSecurityGroup', {
4587
+ enumerable: true,
4588
+ get: function () {
4589
+ return AwsSecurityGroup;
4590
+ }
4591
+ });
4592
+ Object.defineProperty(exports, 'AwsSubnet', {
4593
+ enumerable: true,
4594
+ get: function () {
4595
+ return AwsSubnet;
4596
+ }
4597
+ });
4598
+ Object.defineProperty(exports, 'AwsVpc', {
4599
+ enumerable: true,
4600
+ get: function () {
4601
+ return AwsVpc;
4602
+ }
4603
+ });
4604
+ Object.defineProperty(exports, 'AzureNsg', {
4605
+ enumerable: true,
4606
+ get: function () {
4607
+ return AzureNsg;
4608
+ }
4609
+ });
4610
+ Object.defineProperty(exports, 'AzureSubnet', {
4611
+ enumerable: true,
4612
+ get: function () {
4613
+ return AzureSubnet;
4614
+ }
4615
+ });
4616
+ Object.defineProperty(exports, 'AzureVm', {
4617
+ enumerable: true,
4618
+ get: function () {
4619
+ return AzureVm;
4620
+ }
4621
+ });
4622
+ Object.defineProperty(exports, 'AzureVnet', {
4623
+ enumerable: true,
4624
+ get: function () {
4625
+ return AzureVnet;
4626
+ }
4627
+ });
1483
4628
  exports.BoundedContext = BoundedContext;
4629
+ Object.defineProperty(exports, 'ContainerPlatform', {
4630
+ enumerable: true,
4631
+ get: function () {
4632
+ return ContainerPlatform;
4633
+ }
4634
+ });
4635
+ Object.defineProperty(exports, 'Ec2Instance', {
4636
+ enumerable: true,
4637
+ get: function () {
4638
+ return Ec2Instance;
4639
+ }
4640
+ });
4641
+ exports.Environment = Environment;
1484
4642
  exports.Fractal = Fractal;
4643
+ Object.defineProperty(exports, 'GcpFirewall', {
4644
+ enumerable: true,
4645
+ get: function () {
4646
+ return GcpFirewall;
4647
+ }
4648
+ });
4649
+ Object.defineProperty(exports, 'GcpSubnet', {
4650
+ enumerable: true,
4651
+ get: function () {
4652
+ return GcpSubnet;
4653
+ }
4654
+ });
4655
+ Object.defineProperty(exports, 'GcpVm', {
4656
+ enumerable: true,
4657
+ get: function () {
4658
+ return GcpVm;
4659
+ }
4660
+ });
4661
+ Object.defineProperty(exports, 'GcpVpc', {
4662
+ enumerable: true,
4663
+ get: function () {
4664
+ return GcpVpc;
4665
+ }
4666
+ });
4667
+ Object.defineProperty(exports, 'HetznerFirewall', {
4668
+ enumerable: true,
4669
+ get: function () {
4670
+ return HetznerFirewall;
4671
+ }
4672
+ });
4673
+ Object.defineProperty(exports, 'HetznerNetwork', {
4674
+ enumerable: true,
4675
+ get: function () {
4676
+ return HetznerNetwork;
4677
+ }
4678
+ });
4679
+ Object.defineProperty(exports, 'HetznerServer', {
4680
+ enumerable: true,
4681
+ get: function () {
4682
+ return HetznerServer;
4683
+ }
4684
+ });
4685
+ Object.defineProperty(exports, 'HetznerSubnet', {
4686
+ enumerable: true,
4687
+ get: function () {
4688
+ return HetznerSubnet;
4689
+ }
4690
+ });
1485
4691
  exports.InfrastructureDomain = InfrastructureDomain;
1486
4692
  exports.KebabCaseString = KebabCaseString;
4693
+ exports.LiveSystem = LiveSystem;
4694
+ Object.defineProperty(exports, 'OciInstance', {
4695
+ enumerable: true,
4696
+ get: function () {
4697
+ return OciInstance;
4698
+ }
4699
+ });
4700
+ Object.defineProperty(exports, 'OciSecurityList', {
4701
+ enumerable: true,
4702
+ get: function () {
4703
+ return OciSecurityList;
4704
+ }
4705
+ });
4706
+ Object.defineProperty(exports, 'OciSubnet', {
4707
+ enumerable: true,
4708
+ get: function () {
4709
+ return OciSubnet;
4710
+ }
4711
+ });
4712
+ Object.defineProperty(exports, 'OciVcn', {
4713
+ enumerable: true,
4714
+ get: function () {
4715
+ return OciVcn;
4716
+ }
4717
+ });
1487
4718
  exports.OwnerId = OwnerId;
1488
4719
  exports.OwnerType = OwnerType;
1489
4720
  exports.PascalCaseString = PascalCaseString;
4721
+ Object.defineProperty(exports, 'SecurityGroup', {
4722
+ enumerable: true,
4723
+ get: function () {
4724
+ return SecurityGroup;
4725
+ }
4726
+ });
1490
4727
  exports.ServiceAccountCredentials = ServiceAccountCredentials;
1491
4728
  exports.ServiceAccountId = ServiceAccountId;
1492
4729
  exports.ServiceDeliveryModel = ServiceDeliveryModel;
1493
- exports.Version = Version;
4730
+ Object.defineProperty(exports, 'Subnet', {
4731
+ enumerable: true,
4732
+ get: function () {
4733
+ return Subnet;
4734
+ }
4735
+ });
4736
+ exports.Version = Version;
4737
+ Object.defineProperty(exports, 'VirtualMachine', {
4738
+ enumerable: true,
4739
+ get: function () {
4740
+ return VirtualMachine;
4741
+ }
4742
+ });
4743
+ Object.defineProperty(exports, 'VirtualNetwork', {
4744
+ enumerable: true,
4745
+ get: function () {
4746
+ return VirtualNetwork;
4747
+ }
4748
+ });
4749
+ Object.defineProperty(exports, 'Workload', {
4750
+ enumerable: true,
4751
+ get: function () {
4752
+ return Workload;
4753
+ }
4754
+ });