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