@fractal_cloud/sdk 1.0.0 → 1.2.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
@@ -473,7 +473,7 @@ let ServiceDeliveryModel$1 = /* @__PURE__ */ function(ServiceDeliveryModel) {
473
473
  * if the string is valid.
474
474
  */
475
475
  const isValidPascalCaseString = (value) => {
476
- 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`];
477
477
  return [];
478
478
  };
479
479
  /**
@@ -1143,28 +1143,61 @@ let BlueprintComponent;
1143
1143
  const CLIENT_ID_HEADER$1 = "X-ClientID";
1144
1144
  const CLIENT_SECRET_HEADER$1 = "X-ClientSecret";
1145
1145
  const FRACTAL_API_URL$1 = "https://api.fractal.cloud";
1146
+ /**
1147
+ * Converts a raw superagent error into a descriptive Error with context.
1148
+ * Includes the operation name, target ID, HTTP status (if any), and response
1149
+ * body (if any) so the caller always knows what went wrong and where.
1150
+ */
1151
+ const toApiError$1 = (operation, target, err) => {
1152
+ const e = err;
1153
+ const status = e.status ? `HTTP ${e.status}` : "network error";
1154
+ const body = e.response?.text?.trim();
1155
+ const detail = body ? ` — ${body}` : "";
1156
+ return /* @__PURE__ */ new Error(`${operation} failed (${status}) for ${target}${detail}`);
1157
+ };
1158
+ const authHeaders$1 = (credentials) => ({
1159
+ [CLIENT_ID_HEADER$1]: credentials.id.serviceAccountIdValue,
1160
+ [CLIENT_SECRET_HEADER$1]: credentials.secret
1161
+ });
1146
1162
  const deployFractal = async (credentials, fractal) => {
1147
- const fractalUrl = `${FRACTAL_API_URL$1}/blueprints/${fractal.id.toString().replace(":", "/")}`;
1148
- ((await superagent.get(fractalUrl).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({
1149
- description: fractal.description,
1150
- isPrivate: fractal.isPrivate,
1151
- components: fractal.components.map((c) => ({
1152
- ...c,
1153
- type: c.type.toString(),
1154
- id: c.id.value.toString(),
1155
- version: c.version.toString(),
1156
- parameters: c.parameters.toMap(),
1157
- dependencies: c.dependencies.map((d) => d.id.value.toString()),
1158
- links: c.links.map((l) => ({
1159
- componentId: l.id.value.toString(),
1160
- settings: l.parameters.toMap()
1161
- })),
1162
- outputFields: Object.keys(c.outputFields.value)
1163
- }))
1164
- }).catch((e) => console.error(e.message, e.response.text));
1163
+ const target = fractal.id.toString();
1164
+ const fractalUrl = `${FRACTAL_API_URL$1}/blueprints/${target.replace(":", "/")}`;
1165
+ let getFractalResponse;
1166
+ try {
1167
+ getFractalResponse = await superagent.get(fractalUrl).ok((res) => res.status === 200 || res.status === 404).set(authHeaders$1(credentials)).send();
1168
+ } catch (err) {
1169
+ throw toApiError$1("check fractal existence", target, err);
1170
+ }
1171
+ const request = getFractalResponse.status === 200 ? superagent.put(fractalUrl) : superagent.post(fractalUrl);
1172
+ try {
1173
+ await request.set(authHeaders$1(credentials)).send({
1174
+ description: fractal.description,
1175
+ isPrivate: fractal.isPrivate,
1176
+ components: fractal.components.map((c) => ({
1177
+ ...c,
1178
+ type: c.type.toString(),
1179
+ id: c.id.value.toString(),
1180
+ version: c.version.toString(),
1181
+ parameters: c.parameters.toMap(),
1182
+ dependencies: c.dependencies.map((d) => d.id.value.toString()),
1183
+ links: c.links.map((l) => ({
1184
+ componentId: l.id.value.toString(),
1185
+ settings: l.parameters.toMap()
1186
+ })),
1187
+ outputFields: Object.keys(c.outputFields.value)
1188
+ }))
1189
+ });
1190
+ } catch (err) {
1191
+ throw toApiError$1(getFractalResponse.status === 200 ? "update fractal" : "create fractal", target, err);
1192
+ }
1165
1193
  };
1166
1194
  const destroyFractal = async (credentials, id) => {
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);
1195
+ const target = id.toString();
1196
+ try {
1197
+ await superagent.delete(`${FRACTAL_API_URL$1}/blueprints/${target.replace(":", "/")}`).set(authHeaders$1(credentials));
1198
+ } catch (err) {
1199
+ throw toApiError$1("destroy fractal", target, err);
1200
+ }
1168
1201
  };
1169
1202
  let FractalService;
1170
1203
  (function(_FractalService) {
@@ -1213,7 +1246,8 @@ const DEFAULT_FRACTAL = {
1213
1246
  const isValidFractal = (fractal) => {
1214
1247
  const idErrors = addContextToErrors$4(fractal.id, isValidFractalId(fractal.id));
1215
1248
  const componentsErrors = addContextToErrors$4(fractal.id, !fractal.components || fractal.components.length === 0 ? ["[Components] Components must not be empty"] : fractal.components.reduce((acc, x) => {
1216
- acc.push(...isValidBlueprintComponent(x));
1249
+ if ("provider" in x) acc.push(`[Component: ${x.id.toString()}] Live system components cannot be added to a Fractal blueprint. Use LiveSystem.withComponent() instead.`);
1250
+ else acc.push(...isValidBlueprintComponent(x));
1217
1251
  return acc;
1218
1252
  }, []));
1219
1253
  return [...idErrors, ...componentsErrors];
@@ -1805,43 +1839,178 @@ const getLiveSystemComponentBuilder = () => {
1805
1839
  const CLIENT_ID_HEADER = "X-ClientID";
1806
1840
  const CLIENT_SECRET_HEADER = "X-ClientSecret";
1807
1841
  const FRACTAL_API_URL = "https://api.fractal.cloud";
1808
- const deployLiveSystem = async (credentials, liveSystem) => {
1809
- const body = {
1810
- liveSystemId: liveSystem.id.toString(),
1811
- fractalId: liveSystem.fractalId.toString(),
1812
- description: liveSystem.description,
1813
- provider: liveSystem.genericProvider,
1814
- blueprintMap: liveSystem.components.reduce((acc, c) => {
1815
- acc[c.id.value.toString()] = {
1816
- ...c,
1817
- type: c.type.toString(),
1818
- id: c.id.value.toString(),
1819
- version: c.version.toString(),
1820
- parameters: c.parameters.toMap(),
1821
- dependencies: c.dependencies.map((d) => d.id.value.toString()),
1822
- links: c.links.map((l) => ({
1823
- componentId: l.id.value.toString(),
1824
- settings: l.parameters.toMap()
1825
- })),
1826
- outputFields: c.outputFields.value
1827
- };
1828
- return acc;
1829
- }, {}),
1830
- parameters: liveSystem.parameters.toMap(),
1831
- environment: {
1832
- id: {
1833
- type: liveSystem.environment.id.ownerType,
1834
- ownerId: liveSystem.environment.id.ownerId.toString(),
1835
- shortName: liveSystem.environment.id.name.toString()
1836
- },
1837
- parameters: liveSystem.environment.parameters.toMap()
1842
+ const DEFAULT_POLL_INTERVAL_MS = 5e3;
1843
+ const DEFAULT_TIMEOUT_MS = 6e5;
1844
+ const TERMINAL_FAILURE_STATUSES = ["FailedMutation", "Error"];
1845
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
1846
+ const log = (quiet, level, message, fields) => {
1847
+ if (quiet) return;
1848
+ const ts = (/* @__PURE__ */ new Date()).toISOString();
1849
+ const fieldStr = fields ? " " + Object.entries(fields).map(([k, v]) => `${k}=${v}`).join(" ") : "";
1850
+ console.log(`[${ts}] ${level.padEnd(5)} ${message}${fieldStr}`);
1851
+ };
1852
+ const elapsedSec = (startMs) => `${Math.round((Date.now() - startMs) / 1e3)}s`;
1853
+ /**
1854
+ * Converts a raw superagent error into a descriptive Error with context.
1855
+ * Includes the operation name, target ID, HTTP status (if any), and response
1856
+ * body (if any) so the caller always knows what went wrong and where.
1857
+ */
1858
+ const toApiError = (operation, target, err) => {
1859
+ const e = err;
1860
+ const status = e.status ? `HTTP ${e.status}` : "network error";
1861
+ const body = e.response?.text?.trim();
1862
+ const detail = body ? ` — ${body}` : "";
1863
+ return /* @__PURE__ */ new Error(`${operation} failed (${status}) for ${target}${detail}`);
1864
+ };
1865
+ /**
1866
+ * Returns true for 4xx client errors that will not self-heal on retry
1867
+ * (e.g. 401 Unauthorized, 403 Forbidden, 404 Not Found, 422 Unprocessable).
1868
+ */
1869
+ const isClientError = (err) => {
1870
+ const status = err.status;
1871
+ return status !== void 0 && status >= 400 && status < 500;
1872
+ };
1873
+ const authHeaders = (credentials) => ({
1874
+ [CLIENT_ID_HEADER]: credentials.id.serviceAccountIdValue,
1875
+ [CLIENT_SECRET_HEADER]: credentials.secret
1876
+ });
1877
+ const buildBody = (liveSystem) => ({
1878
+ liveSystemId: liveSystem.id.toString(),
1879
+ fractalId: liveSystem.fractalId.toString(),
1880
+ description: liveSystem.description,
1881
+ provider: liveSystem.genericProvider,
1882
+ blueprintMap: liveSystem.components.reduce((acc, c) => {
1883
+ acc[c.id.value.toString()] = {
1884
+ ...c,
1885
+ type: c.type.toString(),
1886
+ id: c.id.value.toString(),
1887
+ version: c.version.toString(),
1888
+ parameters: c.parameters.toMap(),
1889
+ dependencies: c.dependencies.map((d) => d.id.value.toString()),
1890
+ links: c.links.map((l) => ({
1891
+ componentId: l.id.value.toString(),
1892
+ settings: l.parameters.toMap()
1893
+ })),
1894
+ outputFields: c.outputFields.value
1895
+ };
1896
+ return acc;
1897
+ }, {}),
1898
+ parameters: liveSystem.parameters.toMap(),
1899
+ environment: {
1900
+ id: {
1901
+ type: liveSystem.environment.id.ownerType,
1902
+ ownerId: liveSystem.environment.id.ownerId.toString(),
1903
+ shortName: liveSystem.environment.id.name.toString()
1904
+ },
1905
+ parameters: liveSystem.environment.parameters.toMap()
1906
+ }
1907
+ });
1908
+ const submitDeploy = async (credentials, liveSystem) => {
1909
+ const target = liveSystem.id.toString();
1910
+ const liveSystemUrl = `${FRACTAL_API_URL}/livesystems/${target}`;
1911
+ let getResponse;
1912
+ try {
1913
+ getResponse = await superagent.get(liveSystemUrl).ok((res) => res.status === 200 || res.status === 404).set(authHeaders(credentials)).send();
1914
+ } catch (err) {
1915
+ throw toApiError("check live system existence", target, err);
1916
+ }
1917
+ const request = getResponse.status === 200 ? superagent.put(liveSystemUrl) : superagent.post(`${FRACTAL_API_URL}/livesystems`);
1918
+ try {
1919
+ await request.set(authHeaders(credentials)).send(buildBody(liveSystem));
1920
+ } catch (err) {
1921
+ throw toApiError(getResponse.status === 200 ? "update live system" : "create live system", target, err);
1922
+ }
1923
+ };
1924
+ const getLiveSystemStatus = async (credentials, id) => {
1925
+ try {
1926
+ return (await superagent.get(`${FRACTAL_API_URL}/livesystems/${id.toString()}`).set(authHeaders(credentials)).send()).body.status;
1927
+ } catch (err) {
1928
+ throw toApiError("get live system status", id.toString(), err);
1929
+ }
1930
+ };
1931
+ const pollUntilActive = async (credentials, id, options, startMs) => {
1932
+ const quiet = options.quiet ?? false;
1933
+ const interval = options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
1934
+ const timeout = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
1935
+ const deadline = Date.now() + timeout;
1936
+ let round = 0;
1937
+ while (Date.now() < deadline) {
1938
+ await sleep(interval);
1939
+ round++;
1940
+ let status;
1941
+ try {
1942
+ status = await getLiveSystemStatus(credentials, id);
1943
+ } catch (err) {
1944
+ if (isClientError(err)) {
1945
+ const message = err instanceof Error ? err.message : String(err);
1946
+ log(quiet, "ERROR", "Fatal error polling Live System status", {
1947
+ system: id.toString(),
1948
+ round,
1949
+ elapsed: elapsedSec(startMs),
1950
+ error: message
1951
+ });
1952
+ throw err;
1953
+ }
1954
+ const message = err instanceof Error ? err.message : String(err);
1955
+ log(quiet, "WARN", "Transient error polling status, will retry", {
1956
+ system: id.toString(),
1957
+ round,
1958
+ elapsed: elapsedSec(startMs),
1959
+ error: message
1960
+ });
1961
+ continue;
1838
1962
  }
1839
- };
1840
- const liveSystemUrl = `${FRACTAL_API_URL}/livesystems/${liveSystem.id.toString()}`;
1841
- ((await superagent.get(liveSystemUrl).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));
1963
+ if (status === "Active") return;
1964
+ if (TERMINAL_FAILURE_STATUSES.includes(status)) {
1965
+ log(quiet, "ERROR", "Live System deployment failed", {
1966
+ system: id.toString(),
1967
+ status,
1968
+ elapsed: elapsedSec(startMs)
1969
+ });
1970
+ throw new Error(`Live system deployment failed with status: ${status} — check the Fractal Cloud console for component-level errors`);
1971
+ }
1972
+ log(quiet, "CHECK", "Polling Live System status", {
1973
+ system: id.toString(),
1974
+ round,
1975
+ status,
1976
+ elapsed: elapsedSec(startMs)
1977
+ });
1978
+ }
1979
+ log(quiet, "ERROR", "Live System deployment timed out", {
1980
+ system: id.toString(),
1981
+ elapsed: elapsedSec(startMs),
1982
+ timeoutMs: timeout
1983
+ });
1984
+ throw new Error(`Live system deployment timed out after ${timeout}ms. Increase timeoutMs in DeployOptions if provisioning takes longer.`);
1985
+ };
1986
+ const deployLiveSystem = async (credentials, liveSystem, options = { mode: "fire-and-forget" }) => {
1987
+ if (options.mode === "fire-and-forget") {
1988
+ submitDeploy(credentials, liveSystem).catch((err) => {
1989
+ const message = err instanceof Error ? err.message : String(err);
1990
+ console.error(`[Fractal] live system deploy error: ${message}`);
1991
+ });
1992
+ return;
1993
+ }
1994
+ const quiet = options.quiet ?? false;
1995
+ const startMs = Date.now();
1996
+ log(quiet, "INFO", "Deploying Live System", {
1997
+ system: liveSystem.id.toString(),
1998
+ fractal: liveSystem.fractalId.toString(),
1999
+ provider: liveSystem.genericProvider
2000
+ });
2001
+ await submitDeploy(credentials, liveSystem);
2002
+ await pollUntilActive(credentials, liveSystem.id, options, startMs);
2003
+ log(quiet, "INFO", "Live System Active", {
2004
+ system: liveSystem.id.toString(),
2005
+ elapsed: elapsedSec(startMs)
2006
+ });
1842
2007
  };
1843
2008
  const destroyLiveSystem = async (credentials, id) => {
1844
- await superagent.delete(`${FRACTAL_API_URL}/livesystems/${id.toString()}`).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret);
2009
+ try {
2010
+ await superagent.delete(`${FRACTAL_API_URL}/livesystems/${id.toString()}`).set(authHeaders(credentials));
2011
+ } catch (err) {
2012
+ throw toApiError("destroy live system", id.toString(), err);
2013
+ }
1845
2014
  };
1846
2015
  let LiveSystemService;
1847
2016
  (function(_LiveSystemService) {
@@ -1986,7 +2155,7 @@ const getLiveSystemBuilder = () => {
1986
2155
  if (validationErrors.length > 0) throw new SyntaxError(validationErrors.join("\n"));
1987
2156
  return {
1988
2157
  ...internalState,
1989
- deploy: (credentials) => LiveSystemService.deploy(credentials, internalState),
2158
+ deploy: (credentials, options) => LiveSystemService.deploy(credentials, internalState, options),
1990
2159
  destroy: (credentials) => LiveSystemService.destroy(credentials, internalState.id)
1991
2160
  };
1992
2161
  }
@@ -2009,6 +2178,2528 @@ let LiveSystem$1;
2009
2178
  _LiveSystem.getBuilder = getLiveSystemBuilder;
2010
2179
  })(LiveSystem$1 || (LiveSystem$1 = {}));
2011
2180
 
2181
+ //#endregion
2182
+ //#region src/fractal/component/network_and_compute/iaas/virtual_network.ts
2183
+ const VIRTUAL_NETWORK_TYPE_NAME = "VirtualNetwork";
2184
+ const CIDR_BLOCK_PARAM$1 = "cidrBlock";
2185
+ function buildId$28(id) {
2186
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2187
+ }
2188
+ function buildVersion$28(major, minor, patch) {
2189
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2190
+ }
2191
+ function buildVirtualNetworkType() {
2192
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(VIRTUAL_NETWORK_TYPE_NAME).build()).build();
2193
+ }
2194
+ function pushParam$25(params, key, value) {
2195
+ params.push(key, value);
2196
+ }
2197
+ function makeVirtualNetworkComponent(vpc, subnetNodes, sgs) {
2198
+ const vpcDep = { id: vpc.id };
2199
+ const wiredSubnets = subnetNodes.map((n) => ({
2200
+ ...n.subnet,
2201
+ dependencies: [...n.subnet.dependencies, vpcDep]
2202
+ }));
2203
+ const wiredSgs = sgs.map((sg) => ({
2204
+ ...sg,
2205
+ dependencies: [vpcDep]
2206
+ }));
2207
+ const allVMs = subnetNodes.flatMap((n) => n.virtualMachines);
2208
+ const allEcsSvcs = subnetNodes.flatMap((n) => n.workloads);
2209
+ return {
2210
+ vpc,
2211
+ subnets: wiredSubnets,
2212
+ securityGroups: wiredSgs,
2213
+ virtualMachines: allVMs,
2214
+ workloads: allEcsSvcs,
2215
+ components: [
2216
+ vpc,
2217
+ ...wiredSubnets,
2218
+ ...wiredSgs,
2219
+ ...allVMs,
2220
+ ...allEcsSvcs
2221
+ ],
2222
+ withSubnets: (newSubnets) => makeVirtualNetworkComponent(vpc, newSubnets, sgs),
2223
+ withSecurityGroups: (newSgs) => makeVirtualNetworkComponent(vpc, subnetNodes, newSgs)
2224
+ };
2225
+ }
2226
+ let VirtualNetwork;
2227
+ (function(_VirtualNetwork) {
2228
+ const getBuilder = _VirtualNetwork.getBuilder = () => {
2229
+ const params = getParametersInstance();
2230
+ const inner = getBlueprintComponentBuilder().withType(buildVirtualNetworkType()).withParameters(params);
2231
+ const subnetBuilders = [];
2232
+ const sgBuilders = [];
2233
+ const builder = {
2234
+ withId: (id) => {
2235
+ inner.withId(buildId$28(id));
2236
+ return builder;
2237
+ },
2238
+ withVersion: (major, minor, patch) => {
2239
+ inner.withVersion(buildVersion$28(major, minor, patch));
2240
+ return builder;
2241
+ },
2242
+ withDisplayName: (displayName) => {
2243
+ inner.withDisplayName(displayName);
2244
+ return builder;
2245
+ },
2246
+ withDescription: (description) => {
2247
+ inner.withDescription(description);
2248
+ return builder;
2249
+ },
2250
+ withCidrBlock: (value) => {
2251
+ pushParam$25(params, CIDR_BLOCK_PARAM$1, value);
2252
+ return builder;
2253
+ },
2254
+ withSubnet: (subnetBuilder) => {
2255
+ subnetBuilders.push(subnetBuilder);
2256
+ return builder;
2257
+ },
2258
+ withSecurityGroup: (sgBuilder) => {
2259
+ sgBuilders.push(sgBuilder);
2260
+ return builder;
2261
+ },
2262
+ withLinks: (links) => {
2263
+ inner.withLinks(links);
2264
+ return builder;
2265
+ },
2266
+ build: () => {
2267
+ const vpc = inner.build();
2268
+ const vpcDep = { id: vpc.id };
2269
+ const subnetResults = subnetBuilders.map((b) => b.build());
2270
+ const subnets = subnetResults.map((r) => ({
2271
+ ...r.subnet,
2272
+ dependencies: [...r.subnet.dependencies, vpcDep]
2273
+ }));
2274
+ const virtualMachines = subnetResults.flatMap((r) => r.virtualMachines);
2275
+ const securityGroups = sgBuilders.map((b) => ({
2276
+ ...b.build(),
2277
+ dependencies: [vpcDep]
2278
+ }));
2279
+ return {
2280
+ vpc,
2281
+ subnets,
2282
+ securityGroups,
2283
+ virtualMachines,
2284
+ components: [
2285
+ vpc,
2286
+ ...subnets,
2287
+ ...securityGroups,
2288
+ ...virtualMachines
2289
+ ]
2290
+ };
2291
+ }
2292
+ };
2293
+ return builder;
2294
+ };
2295
+ _VirtualNetwork.create = (config) => {
2296
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
2297
+ if (config.cidrBlock) b.withCidrBlock(config.cidrBlock);
2298
+ if (config.description) b.withDescription(config.description);
2299
+ return makeVirtualNetworkComponent(b.build().vpc, [], []);
2300
+ };
2301
+ })(VirtualNetwork || (VirtualNetwork = {}));
2302
+
2303
+ //#endregion
2304
+ //#region src/fractal/component/network_and_compute/iaas/subnet.ts
2305
+ const SUBNET_TYPE_NAME = "Subnet";
2306
+ const CIDR_BLOCK_PARAM = "cidrBlock";
2307
+ function buildId$27(id) {
2308
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2309
+ }
2310
+ function buildVersion$27(major, minor, patch) {
2311
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2312
+ }
2313
+ function buildSubnetType() {
2314
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(SUBNET_TYPE_NAME).build()).build();
2315
+ }
2316
+ function pushParam$24(params, key, value) {
2317
+ params.push(key, value);
2318
+ }
2319
+ function makeSubnetComponent(subnet, vms, workloadNodes) {
2320
+ const subnetDep = { id: subnet.id };
2321
+ const wiredVMs = vms.map((n) => ({
2322
+ ...n.component,
2323
+ dependencies: [...n.component.dependencies, subnetDep]
2324
+ }));
2325
+ const wiredWorkloads = workloadNodes.map((w) => ({
2326
+ ...w.component,
2327
+ dependencies: [...w.component.dependencies, subnetDep]
2328
+ }));
2329
+ return {
2330
+ subnet,
2331
+ virtualMachines: wiredVMs,
2332
+ workloads: wiredWorkloads,
2333
+ components: [
2334
+ subnet,
2335
+ ...wiredVMs,
2336
+ ...wiredWorkloads
2337
+ ],
2338
+ withVirtualMachines: (newVMs) => makeSubnetComponent(subnet, newVMs, workloadNodes),
2339
+ withWorkloads: (newWorkloads) => makeSubnetComponent(subnet, vms, newWorkloads)
2340
+ };
2341
+ }
2342
+ let Subnet;
2343
+ (function(_Subnet) {
2344
+ const getBuilder = _Subnet.getBuilder = () => {
2345
+ const params = getParametersInstance();
2346
+ const inner = getBlueprintComponentBuilder().withType(buildSubnetType()).withParameters(params);
2347
+ const vmBuilders = [];
2348
+ const builder = {
2349
+ withId: (id) => {
2350
+ inner.withId(buildId$27(id));
2351
+ return builder;
2352
+ },
2353
+ withVersion: (major, minor, patch) => {
2354
+ inner.withVersion(buildVersion$27(major, minor, patch));
2355
+ return builder;
2356
+ },
2357
+ withDisplayName: (displayName) => {
2358
+ inner.withDisplayName(displayName);
2359
+ return builder;
2360
+ },
2361
+ withDescription: (description) => {
2362
+ inner.withDescription(description);
2363
+ return builder;
2364
+ },
2365
+ withCidrBlock: (value) => {
2366
+ pushParam$24(params, CIDR_BLOCK_PARAM, value);
2367
+ return builder;
2368
+ },
2369
+ withVirtualMachine: (vmBuilder) => {
2370
+ vmBuilders.push(vmBuilder);
2371
+ return builder;
2372
+ },
2373
+ withLinks: (links) => {
2374
+ inner.withLinks(links);
2375
+ return builder;
2376
+ },
2377
+ build: () => {
2378
+ const subnet = inner.build();
2379
+ const subnetDep = { id: subnet.id };
2380
+ const virtualMachines = vmBuilders.map((b) => ({
2381
+ ...b.build(),
2382
+ dependencies: [subnetDep]
2383
+ }));
2384
+ return {
2385
+ subnet,
2386
+ virtualMachines,
2387
+ components: [subnet, ...virtualMachines]
2388
+ };
2389
+ }
2390
+ };
2391
+ return builder;
2392
+ };
2393
+ _Subnet.create = (config) => {
2394
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
2395
+ if (config.cidrBlock) b.withCidrBlock(config.cidrBlock);
2396
+ if (config.description) b.withDescription(config.description);
2397
+ return makeSubnetComponent(b.build().subnet, [], []);
2398
+ };
2399
+ })(Subnet || (Subnet = {}));
2400
+
2401
+ //#endregion
2402
+ //#region src/fractal/component/network_and_compute/iaas/security_group.ts
2403
+ const SECURITY_GROUP_TYPE_NAME = "SecurityGroup";
2404
+ const DESCRIPTION_PARAM = "description";
2405
+ const INGRESS_RULES_PARAM = "ingressRules";
2406
+ function buildId$26(id) {
2407
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2408
+ }
2409
+ function buildVersion$26(major, minor, patch) {
2410
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2411
+ }
2412
+ function buildSecurityGroupType() {
2413
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(SECURITY_GROUP_TYPE_NAME).build()).build();
2414
+ }
2415
+ function pushParam$23(params, key, value) {
2416
+ params.push(key, value);
2417
+ }
2418
+ let SecurityGroup;
2419
+ (function(_SecurityGroup) {
2420
+ const getBuilder = _SecurityGroup.getBuilder = () => {
2421
+ const params = getParametersInstance();
2422
+ const inner = getBlueprintComponentBuilder().withType(buildSecurityGroupType()).withParameters(params);
2423
+ const builder = {
2424
+ withId: (id) => {
2425
+ inner.withId(buildId$26(id));
2426
+ return builder;
2427
+ },
2428
+ withVersion: (major, minor, patch) => {
2429
+ inner.withVersion(buildVersion$26(major, minor, patch));
2430
+ return builder;
2431
+ },
2432
+ withDisplayName: (displayName) => {
2433
+ inner.withDisplayName(displayName);
2434
+ return builder;
2435
+ },
2436
+ withDescription: (description) => {
2437
+ inner.withDescription(description);
2438
+ pushParam$23(params, DESCRIPTION_PARAM, description);
2439
+ return builder;
2440
+ },
2441
+ withIngressRules: (rules) => {
2442
+ pushParam$23(params, INGRESS_RULES_PARAM, rules);
2443
+ return builder;
2444
+ },
2445
+ withLinks: (links) => {
2446
+ inner.withLinks(links);
2447
+ return builder;
2448
+ },
2449
+ build: () => inner.build()
2450
+ };
2451
+ return builder;
2452
+ };
2453
+ _SecurityGroup.create = (config) => {
2454
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withDescription(config.description);
2455
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
2456
+ return b.build();
2457
+ };
2458
+ })(SecurityGroup || (SecurityGroup = {}));
2459
+
2460
+ //#endregion
2461
+ //#region src/fractal/component/network_and_compute/iaas/vm.ts
2462
+ const VIRTUAL_MACHINE_TYPE_NAME = "VirtualMachine";
2463
+ function buildId$25(id) {
2464
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2465
+ }
2466
+ function buildVersion$25(major, minor, patch) {
2467
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2468
+ }
2469
+ function buildVirtualMachineType() {
2470
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(VIRTUAL_MACHINE_TYPE_NAME).build()).build();
2471
+ }
2472
+ function buildLinkParams$1(link) {
2473
+ const params = getParametersInstance();
2474
+ params.push("fromPort", link.fromPort);
2475
+ if (link.toPort !== void 0) params.push("toPort", link.toPort);
2476
+ if (link.protocol) params.push("protocol", link.protocol);
2477
+ return params;
2478
+ }
2479
+ function makeVirtualMachineComponent(component) {
2480
+ return {
2481
+ component,
2482
+ components: [component],
2483
+ linkToVirtualMachine: (links) => {
2484
+ const componentLinks = links.map((l) => getLinkBuilder().withId(l.target.component.id).withType(buildVirtualMachineType()).withParameters(buildLinkParams$1(l)).build());
2485
+ return makeVirtualMachineComponent({
2486
+ ...component,
2487
+ links: [...component.links, ...componentLinks]
2488
+ });
2489
+ },
2490
+ linkToSecurityGroup: (sgs) => {
2491
+ const sgLinks = sgs.map((sg) => getLinkBuilder().withId(sg.id).withType(sg.type).withParameters(getParametersInstance()).build());
2492
+ return makeVirtualMachineComponent({
2493
+ ...component,
2494
+ links: [...component.links, ...sgLinks]
2495
+ });
2496
+ }
2497
+ };
2498
+ }
2499
+ let VirtualMachine;
2500
+ (function(_VirtualMachine) {
2501
+ const getBuilder = _VirtualMachine.getBuilder = () => {
2502
+ const inner = getBlueprintComponentBuilder().withType(buildVirtualMachineType()).withParameters(getParametersInstance());
2503
+ const builder = {
2504
+ withId: (id) => {
2505
+ inner.withId(buildId$25(id));
2506
+ return builder;
2507
+ },
2508
+ withVersion: (major, minor, patch) => {
2509
+ inner.withVersion(buildVersion$25(major, minor, patch));
2510
+ return builder;
2511
+ },
2512
+ withDisplayName: (displayName) => {
2513
+ inner.withDisplayName(displayName);
2514
+ return builder;
2515
+ },
2516
+ withDescription: (description) => {
2517
+ inner.withDescription(description);
2518
+ return builder;
2519
+ },
2520
+ withLinks: (links) => {
2521
+ inner.withLinks(links);
2522
+ return builder;
2523
+ },
2524
+ build: () => inner.build()
2525
+ };
2526
+ return builder;
2527
+ };
2528
+ _VirtualMachine.create = (config) => {
2529
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
2530
+ if (config.description) b.withDescription(config.description);
2531
+ return makeVirtualMachineComponent(b.build());
2532
+ };
2533
+ })(VirtualMachine || (VirtualMachine = {}));
2534
+
2535
+ //#endregion
2536
+ //#region src/live_system/component/network_and_compute/iaas/vpc.ts
2537
+ const AWS_VPC_TYPE_NAME = "AwsVpc";
2538
+ const INSTANCE_TENANCY_PARAM = "instanceTenancy";
2539
+ const ENABLE_DNS_SUPPORT_PARAM = "enableDnsSupport";
2540
+ const ENABLE_DNS_HOSTNAMES_PARAM = "enableDnsHostnames";
2541
+ function buildId$24(id) {
2542
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2543
+ }
2544
+ function buildVersion$24(major, minor, patch) {
2545
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2546
+ }
2547
+ function buildAwsVpcType() {
2548
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AWS_VPC_TYPE_NAME).build()).build();
2549
+ }
2550
+ function pushParam$22(params, key, value) {
2551
+ params.push(key, value);
2552
+ }
2553
+ let AwsVpc;
2554
+ (function(_AwsVpc) {
2555
+ const getBuilder = _AwsVpc.getBuilder = () => {
2556
+ const params = getParametersInstance();
2557
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsVpcType()).withParameters(params).withProvider("AWS");
2558
+ const builder = {
2559
+ withId: (id) => {
2560
+ inner.withId(buildId$24(id));
2561
+ return builder;
2562
+ },
2563
+ withVersion: (major, minor, patch) => {
2564
+ inner.withVersion(buildVersion$24(major, minor, patch));
2565
+ return builder;
2566
+ },
2567
+ withDisplayName: (displayName) => {
2568
+ inner.withDisplayName(displayName);
2569
+ return builder;
2570
+ },
2571
+ withDescription: (description) => {
2572
+ inner.withDescription(description);
2573
+ return builder;
2574
+ },
2575
+ withCidrBlock: (value) => {
2576
+ pushParam$22(params, CIDR_BLOCK_PARAM$1, value);
2577
+ return builder;
2578
+ },
2579
+ withInstanceTenancy: (value) => {
2580
+ pushParam$22(params, INSTANCE_TENANCY_PARAM, value);
2581
+ return builder;
2582
+ },
2583
+ withEnableDnsSupport: (value) => {
2584
+ pushParam$22(params, ENABLE_DNS_SUPPORT_PARAM, value);
2585
+ return builder;
2586
+ },
2587
+ withEnableDnsHostnames: (value) => {
2588
+ pushParam$22(params, ENABLE_DNS_HOSTNAMES_PARAM, value);
2589
+ return builder;
2590
+ },
2591
+ build: () => inner.build()
2592
+ };
2593
+ return builder;
2594
+ };
2595
+ _AwsVpc.satisfy = (blueprint) => {
2596
+ const params = getParametersInstance();
2597
+ 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);
2598
+ if (blueprint.description) inner.withDescription(blueprint.description);
2599
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
2600
+ if (cidrBlock !== null) pushParam$22(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
2601
+ const satisfiedBuilder = {
2602
+ withInstanceTenancy: (value) => {
2603
+ pushParam$22(params, INSTANCE_TENANCY_PARAM, value);
2604
+ return satisfiedBuilder;
2605
+ },
2606
+ withEnableDnsSupport: (value) => {
2607
+ pushParam$22(params, ENABLE_DNS_SUPPORT_PARAM, value);
2608
+ return satisfiedBuilder;
2609
+ },
2610
+ withEnableDnsHostnames: (value) => {
2611
+ pushParam$22(params, ENABLE_DNS_HOSTNAMES_PARAM, value);
2612
+ return satisfiedBuilder;
2613
+ },
2614
+ build: () => inner.build()
2615
+ };
2616
+ return satisfiedBuilder;
2617
+ };
2618
+ _AwsVpc.create = (config) => {
2619
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock);
2620
+ if (config.description) b.withDescription(config.description);
2621
+ if (config.instanceTenancy) b.withInstanceTenancy(config.instanceTenancy);
2622
+ if (config.enableDnsSupport !== void 0) b.withEnableDnsSupport(config.enableDnsSupport);
2623
+ if (config.enableDnsHostnames !== void 0) b.withEnableDnsHostnames(config.enableDnsHostnames);
2624
+ return b.build();
2625
+ };
2626
+ })(AwsVpc || (AwsVpc = {}));
2627
+
2628
+ //#endregion
2629
+ //#region src/live_system/component/network_and_compute/iaas/subnet.ts
2630
+ const AWS_SUBNET_TYPE_NAME = "AwsSubnet";
2631
+ const AVAILABILITY_ZONE_PARAM = "availabilityZone";
2632
+ function buildId$23(id) {
2633
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2634
+ }
2635
+ function buildVersion$23(major, minor, patch) {
2636
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2637
+ }
2638
+ function buildAwsSubnetType() {
2639
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AWS_SUBNET_TYPE_NAME).build()).build();
2640
+ }
2641
+ function pushParam$21(params, key, value) {
2642
+ params.push(key, value);
2643
+ }
2644
+ let AwsSubnet;
2645
+ (function(_AwsSubnet) {
2646
+ const getBuilder = _AwsSubnet.getBuilder = () => {
2647
+ const params = getParametersInstance();
2648
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsSubnetType()).withParameters(params).withProvider("AWS");
2649
+ const builder = {
2650
+ withId: (id) => {
2651
+ inner.withId(buildId$23(id));
2652
+ return builder;
2653
+ },
2654
+ withVersion: (major, minor, patch) => {
2655
+ inner.withVersion(buildVersion$23(major, minor, patch));
2656
+ return builder;
2657
+ },
2658
+ withDisplayName: (displayName) => {
2659
+ inner.withDisplayName(displayName);
2660
+ return builder;
2661
+ },
2662
+ withDescription: (description) => {
2663
+ inner.withDescription(description);
2664
+ return builder;
2665
+ },
2666
+ withCidrBlock: (value) => {
2667
+ pushParam$21(params, CIDR_BLOCK_PARAM, value);
2668
+ return builder;
2669
+ },
2670
+ withAvailabilityZone: (value) => {
2671
+ pushParam$21(params, AVAILABILITY_ZONE_PARAM, value);
2672
+ return builder;
2673
+ },
2674
+ build: () => inner.build()
2675
+ };
2676
+ return builder;
2677
+ };
2678
+ _AwsSubnet.satisfy = (blueprint) => {
2679
+ const params = getParametersInstance();
2680
+ 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);
2681
+ if (blueprint.description) inner.withDescription(blueprint.description);
2682
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
2683
+ if (cidrBlock !== null) pushParam$21(params, CIDR_BLOCK_PARAM, String(cidrBlock));
2684
+ const satisfiedBuilder = {
2685
+ withAvailabilityZone: (value) => {
2686
+ pushParam$21(params, AVAILABILITY_ZONE_PARAM, value);
2687
+ return satisfiedBuilder;
2688
+ },
2689
+ build: () => inner.build()
2690
+ };
2691
+ return satisfiedBuilder;
2692
+ };
2693
+ _AwsSubnet.create = (config) => {
2694
+ 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);
2695
+ if (config.description) b.withDescription(config.description);
2696
+ return b.build();
2697
+ };
2698
+ })(AwsSubnet || (AwsSubnet = {}));
2699
+
2700
+ //#endregion
2701
+ //#region src/live_system/component/network_and_compute/iaas/security_group.ts
2702
+ const AWS_SG_TYPE_NAME = "SecurityGroup";
2703
+ function buildId$22(id) {
2704
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2705
+ }
2706
+ function buildVersion$22(major, minor, patch) {
2707
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2708
+ }
2709
+ function buildAwsSgType() {
2710
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AWS_SG_TYPE_NAME).build()).build();
2711
+ }
2712
+ function pushParam$20(params, key, value) {
2713
+ params.push(key, value);
2714
+ }
2715
+ let AwsSecurityGroup;
2716
+ (function(_AwsSecurityGroup) {
2717
+ const getBuilder = _AwsSecurityGroup.getBuilder = () => {
2718
+ const params = getParametersInstance();
2719
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsSgType()).withParameters(params).withProvider("AWS");
2720
+ const builder = {
2721
+ withId: (id) => {
2722
+ inner.withId(buildId$22(id));
2723
+ return builder;
2724
+ },
2725
+ withVersion: (major, minor, patch) => {
2726
+ inner.withVersion(buildVersion$22(major, minor, patch));
2727
+ return builder;
2728
+ },
2729
+ withDisplayName: (displayName) => {
2730
+ inner.withDisplayName(displayName);
2731
+ return builder;
2732
+ },
2733
+ withDescription: (description) => {
2734
+ inner.withDescription(description);
2735
+ pushParam$20(params, DESCRIPTION_PARAM, description);
2736
+ return builder;
2737
+ },
2738
+ withIngressRules: (rules) => {
2739
+ pushParam$20(params, INGRESS_RULES_PARAM, rules);
2740
+ return builder;
2741
+ },
2742
+ build: () => inner.build()
2743
+ };
2744
+ return builder;
2745
+ };
2746
+ _AwsSecurityGroup.satisfy = (blueprint) => {
2747
+ const params = getParametersInstance();
2748
+ 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);
2749
+ const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
2750
+ if (description !== null) {
2751
+ inner.withDescription(String(description));
2752
+ pushParam$20(params, DESCRIPTION_PARAM, String(description));
2753
+ } else if (blueprint.description) inner.withDescription(blueprint.description);
2754
+ const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
2755
+ if (ingressRules !== null) pushParam$20(params, INGRESS_RULES_PARAM, ingressRules);
2756
+ return { build: () => inner.build() };
2757
+ };
2758
+ _AwsSecurityGroup.create = (config) => {
2759
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withDescription(config.description);
2760
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
2761
+ return b.build();
2762
+ };
2763
+ })(AwsSecurityGroup || (AwsSecurityGroup = {}));
2764
+
2765
+ //#endregion
2766
+ //#region src/live_system/component/network_and_compute/iaas/ec2_instance.ts
2767
+ const EC2_TYPE_NAME = "EC2";
2768
+ const AMI_ID_PARAM = "amiId";
2769
+ const INSTANCE_TYPE_PARAM = "instanceType";
2770
+ const KEY_NAME_PARAM = "keyName";
2771
+ const USER_DATA_PARAM$1 = "userData";
2772
+ const IAM_INSTANCE_PROFILE_PARAM = "iamInstanceProfile";
2773
+ const ASSOCIATE_PUBLIC_IP_PARAM = "associatePublicIp";
2774
+ function buildId$21(id) {
2775
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2776
+ }
2777
+ function buildVersion$21(major, minor, patch) {
2778
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2779
+ }
2780
+ function buildEc2Type() {
2781
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(EC2_TYPE_NAME).build()).build();
2782
+ }
2783
+ function pushParam$19(params, key, value) {
2784
+ params.push(key, value);
2785
+ }
2786
+ let Ec2Instance;
2787
+ (function(_Ec2Instance) {
2788
+ const getBuilder = _Ec2Instance.getBuilder = () => {
2789
+ const params = getParametersInstance();
2790
+ const inner = getLiveSystemComponentBuilder().withType(buildEc2Type()).withParameters(params).withProvider("AWS");
2791
+ const builder = {
2792
+ withId: (id) => {
2793
+ inner.withId(buildId$21(id));
2794
+ return builder;
2795
+ },
2796
+ withVersion: (major, minor, patch) => {
2797
+ inner.withVersion(buildVersion$21(major, minor, patch));
2798
+ return builder;
2799
+ },
2800
+ withDisplayName: (displayName) => {
2801
+ inner.withDisplayName(displayName);
2802
+ return builder;
2803
+ },
2804
+ withDescription: (description) => {
2805
+ inner.withDescription(description);
2806
+ return builder;
2807
+ },
2808
+ withAmiId: (value) => {
2809
+ pushParam$19(params, AMI_ID_PARAM, value);
2810
+ return builder;
2811
+ },
2812
+ withInstanceType: (value) => {
2813
+ pushParam$19(params, INSTANCE_TYPE_PARAM, value);
2814
+ return builder;
2815
+ },
2816
+ withKeyName: (value) => {
2817
+ pushParam$19(params, KEY_NAME_PARAM, value);
2818
+ return builder;
2819
+ },
2820
+ withUserData: (value) => {
2821
+ pushParam$19(params, USER_DATA_PARAM$1, value);
2822
+ return builder;
2823
+ },
2824
+ withIamInstanceProfile: (value) => {
2825
+ pushParam$19(params, IAM_INSTANCE_PROFILE_PARAM, value);
2826
+ return builder;
2827
+ },
2828
+ withAssociatePublicIp: (value) => {
2829
+ pushParam$19(params, ASSOCIATE_PUBLIC_IP_PARAM, value);
2830
+ return builder;
2831
+ },
2832
+ build: () => inner.build()
2833
+ };
2834
+ return builder;
2835
+ };
2836
+ _Ec2Instance.satisfy = (blueprint) => {
2837
+ const params = getParametersInstance();
2838
+ 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);
2839
+ if (blueprint.description) inner.withDescription(blueprint.description);
2840
+ const satisfiedBuilder = {
2841
+ withAmiId: (value) => {
2842
+ pushParam$19(params, AMI_ID_PARAM, value);
2843
+ return satisfiedBuilder;
2844
+ },
2845
+ withInstanceType: (value) => {
2846
+ pushParam$19(params, INSTANCE_TYPE_PARAM, value);
2847
+ return satisfiedBuilder;
2848
+ },
2849
+ withKeyName: (value) => {
2850
+ pushParam$19(params, KEY_NAME_PARAM, value);
2851
+ return satisfiedBuilder;
2852
+ },
2853
+ withUserData: (value) => {
2854
+ pushParam$19(params, USER_DATA_PARAM$1, value);
2855
+ return satisfiedBuilder;
2856
+ },
2857
+ withIamInstanceProfile: (value) => {
2858
+ pushParam$19(params, IAM_INSTANCE_PROFILE_PARAM, value);
2859
+ return satisfiedBuilder;
2860
+ },
2861
+ withAssociatePublicIp: (value) => {
2862
+ pushParam$19(params, ASSOCIATE_PUBLIC_IP_PARAM, value);
2863
+ return satisfiedBuilder;
2864
+ },
2865
+ build: () => inner.build()
2866
+ };
2867
+ return satisfiedBuilder;
2868
+ };
2869
+ _Ec2Instance.create = (config) => {
2870
+ 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);
2871
+ if (config.description) b.withDescription(config.description);
2872
+ if (config.keyName) b.withKeyName(config.keyName);
2873
+ if (config.userData) b.withUserData(config.userData);
2874
+ if (config.iamInstanceProfile) b.withIamInstanceProfile(config.iamInstanceProfile);
2875
+ if (config.associatePublicIp !== void 0) b.withAssociatePublicIp(config.associatePublicIp);
2876
+ return b.build();
2877
+ };
2878
+ })(Ec2Instance || (Ec2Instance = {}));
2879
+
2880
+ //#endregion
2881
+ //#region src/live_system/component/network_and_compute/iaas/azure_vnet.ts
2882
+ const AZURE_VNET_TYPE_NAME = "AzureVnet";
2883
+ const LOCATION_PARAM$3 = "location";
2884
+ const RESOURCE_GROUP_PARAM$3 = "resourceGroup";
2885
+ function buildId$20(id) {
2886
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2887
+ }
2888
+ function buildVersion$20(major, minor, patch) {
2889
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2890
+ }
2891
+ function buildAzureVnetType() {
2892
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_VNET_TYPE_NAME).build()).build();
2893
+ }
2894
+ function pushParam$18(params, key, value) {
2895
+ params.push(key, value);
2896
+ }
2897
+ let AzureVnet;
2898
+ (function(_AzureVnet) {
2899
+ const getBuilder = _AzureVnet.getBuilder = () => {
2900
+ const params = getParametersInstance();
2901
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureVnetType()).withParameters(params).withProvider("Azure");
2902
+ const builder = {
2903
+ withId: (id) => {
2904
+ inner.withId(buildId$20(id));
2905
+ return builder;
2906
+ },
2907
+ withVersion: (major, minor, patch) => {
2908
+ inner.withVersion(buildVersion$20(major, minor, patch));
2909
+ return builder;
2910
+ },
2911
+ withDisplayName: (displayName) => {
2912
+ inner.withDisplayName(displayName);
2913
+ return builder;
2914
+ },
2915
+ withDescription: (description) => {
2916
+ inner.withDescription(description);
2917
+ return builder;
2918
+ },
2919
+ withCidrBlock: (value) => {
2920
+ pushParam$18(params, CIDR_BLOCK_PARAM$1, value);
2921
+ return builder;
2922
+ },
2923
+ withLocation: (value) => {
2924
+ pushParam$18(params, LOCATION_PARAM$3, value);
2925
+ return builder;
2926
+ },
2927
+ withResourceGroup: (value) => {
2928
+ pushParam$18(params, RESOURCE_GROUP_PARAM$3, value);
2929
+ return builder;
2930
+ },
2931
+ build: () => inner.build()
2932
+ };
2933
+ return builder;
2934
+ };
2935
+ _AzureVnet.satisfy = (blueprint) => {
2936
+ const params = getParametersInstance();
2937
+ 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);
2938
+ if (blueprint.description) inner.withDescription(blueprint.description);
2939
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
2940
+ if (cidrBlock !== null) pushParam$18(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
2941
+ const satisfiedBuilder = {
2942
+ withLocation: (value) => {
2943
+ pushParam$18(params, LOCATION_PARAM$3, value);
2944
+ return satisfiedBuilder;
2945
+ },
2946
+ withResourceGroup: (value) => {
2947
+ pushParam$18(params, RESOURCE_GROUP_PARAM$3, value);
2948
+ return satisfiedBuilder;
2949
+ },
2950
+ build: () => inner.build()
2951
+ };
2952
+ return satisfiedBuilder;
2953
+ };
2954
+ _AzureVnet.create = (config) => {
2955
+ 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);
2956
+ if (config.description) b.withDescription(config.description);
2957
+ return b.build();
2958
+ };
2959
+ })(AzureVnet || (AzureVnet = {}));
2960
+
2961
+ //#endregion
2962
+ //#region src/live_system/component/network_and_compute/iaas/azure_subnet.ts
2963
+ const AZURE_SUBNET_TYPE_NAME = "AzureSubnet";
2964
+ const RESOURCE_GROUP_PARAM$2 = "resourceGroup";
2965
+ function buildId$19(id) {
2966
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
2967
+ }
2968
+ function buildVersion$19(major, minor, patch) {
2969
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
2970
+ }
2971
+ function buildAzureSubnetType() {
2972
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_SUBNET_TYPE_NAME).build()).build();
2973
+ }
2974
+ function pushParam$17(params, key, value) {
2975
+ params.push(key, value);
2976
+ }
2977
+ let AzureSubnet;
2978
+ (function(_AzureSubnet) {
2979
+ const getBuilder = _AzureSubnet.getBuilder = () => {
2980
+ const params = getParametersInstance();
2981
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureSubnetType()).withParameters(params).withProvider("Azure");
2982
+ const builder = {
2983
+ withId: (id) => {
2984
+ inner.withId(buildId$19(id));
2985
+ return builder;
2986
+ },
2987
+ withVersion: (major, minor, patch) => {
2988
+ inner.withVersion(buildVersion$19(major, minor, patch));
2989
+ return builder;
2990
+ },
2991
+ withDisplayName: (displayName) => {
2992
+ inner.withDisplayName(displayName);
2993
+ return builder;
2994
+ },
2995
+ withDescription: (description) => {
2996
+ inner.withDescription(description);
2997
+ return builder;
2998
+ },
2999
+ withCidrBlock: (value) => {
3000
+ pushParam$17(params, CIDR_BLOCK_PARAM, value);
3001
+ return builder;
3002
+ },
3003
+ withResourceGroup: (value) => {
3004
+ pushParam$17(params, RESOURCE_GROUP_PARAM$2, value);
3005
+ return builder;
3006
+ },
3007
+ build: () => inner.build()
3008
+ };
3009
+ return builder;
3010
+ };
3011
+ _AzureSubnet.satisfy = (blueprint) => {
3012
+ const params = getParametersInstance();
3013
+ 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);
3014
+ if (blueprint.description) inner.withDescription(blueprint.description);
3015
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
3016
+ if (cidrBlock !== null) pushParam$17(params, CIDR_BLOCK_PARAM, String(cidrBlock));
3017
+ const satisfiedBuilder = {
3018
+ withResourceGroup: (value) => {
3019
+ pushParam$17(params, RESOURCE_GROUP_PARAM$2, value);
3020
+ return satisfiedBuilder;
3021
+ },
3022
+ build: () => inner.build()
3023
+ };
3024
+ return satisfiedBuilder;
3025
+ };
3026
+ _AzureSubnet.create = (config) => {
3027
+ 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);
3028
+ if (config.description) b.withDescription(config.description);
3029
+ return b.build();
3030
+ };
3031
+ })(AzureSubnet || (AzureSubnet = {}));
3032
+
3033
+ //#endregion
3034
+ //#region src/live_system/component/network_and_compute/iaas/azure_nsg.ts
3035
+ const AZURE_NSG_TYPE_NAME = "AzureNsg";
3036
+ const LOCATION_PARAM$2 = "location";
3037
+ const RESOURCE_GROUP_PARAM$1 = "resourceGroup";
3038
+ function buildId$18(id) {
3039
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3040
+ }
3041
+ function buildVersion$18(major, minor, patch) {
3042
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3043
+ }
3044
+ function buildAzureNsgType() {
3045
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_NSG_TYPE_NAME).build()).build();
3046
+ }
3047
+ function pushParam$16(params, key, value) {
3048
+ params.push(key, value);
3049
+ }
3050
+ let AzureNsg;
3051
+ (function(_AzureNsg) {
3052
+ const getBuilder = _AzureNsg.getBuilder = () => {
3053
+ const params = getParametersInstance();
3054
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureNsgType()).withParameters(params).withProvider("Azure");
3055
+ const builder = {
3056
+ withId: (id) => {
3057
+ inner.withId(buildId$18(id));
3058
+ return builder;
3059
+ },
3060
+ withVersion: (major, minor, patch) => {
3061
+ inner.withVersion(buildVersion$18(major, minor, patch));
3062
+ return builder;
3063
+ },
3064
+ withDisplayName: (displayName) => {
3065
+ inner.withDisplayName(displayName);
3066
+ return builder;
3067
+ },
3068
+ withDescription: (description) => {
3069
+ inner.withDescription(description);
3070
+ pushParam$16(params, DESCRIPTION_PARAM, description);
3071
+ return builder;
3072
+ },
3073
+ withIngressRules: (rules) => {
3074
+ pushParam$16(params, INGRESS_RULES_PARAM, rules);
3075
+ return builder;
3076
+ },
3077
+ withLocation: (value) => {
3078
+ pushParam$16(params, LOCATION_PARAM$2, value);
3079
+ return builder;
3080
+ },
3081
+ withResourceGroup: (value) => {
3082
+ pushParam$16(params, RESOURCE_GROUP_PARAM$1, value);
3083
+ return builder;
3084
+ },
3085
+ build: () => inner.build()
3086
+ };
3087
+ return builder;
3088
+ };
3089
+ _AzureNsg.satisfy = (blueprint) => {
3090
+ const params = getParametersInstance();
3091
+ 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);
3092
+ const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
3093
+ if (description !== null) {
3094
+ inner.withDescription(String(description));
3095
+ pushParam$16(params, DESCRIPTION_PARAM, String(description));
3096
+ } else if (blueprint.description) inner.withDescription(blueprint.description);
3097
+ const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
3098
+ if (ingressRules !== null) pushParam$16(params, INGRESS_RULES_PARAM, ingressRules);
3099
+ const satisfiedBuilder = {
3100
+ withLocation: (value) => {
3101
+ pushParam$16(params, LOCATION_PARAM$2, value);
3102
+ return satisfiedBuilder;
3103
+ },
3104
+ withResourceGroup: (value) => {
3105
+ pushParam$16(params, RESOURCE_GROUP_PARAM$1, value);
3106
+ return satisfiedBuilder;
3107
+ },
3108
+ build: () => inner.build()
3109
+ };
3110
+ return satisfiedBuilder;
3111
+ };
3112
+ _AzureNsg.create = (config) => {
3113
+ 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);
3114
+ if (config.description) b.withDescription(config.description);
3115
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
3116
+ return b.build();
3117
+ };
3118
+ })(AzureNsg || (AzureNsg = {}));
3119
+
3120
+ //#endregion
3121
+ //#region src/live_system/component/network_and_compute/iaas/azure_vm.ts
3122
+ const AZURE_VM_TYPE_NAME = "AzureVm";
3123
+ const VM_SIZE_PARAM = "vmSize";
3124
+ const LOCATION_PARAM$1 = "location";
3125
+ const RESOURCE_GROUP_PARAM = "resourceGroup";
3126
+ const ADMIN_USERNAME_PARAM = "adminUsername";
3127
+ const IMAGE_PUBLISHER_PARAM = "imagePublisher";
3128
+ const IMAGE_OFFER_PARAM = "imageOffer";
3129
+ const IMAGE_SKU_PARAM = "imageSku";
3130
+ const SSH_PUBLIC_KEY_PARAM$1 = "sshPublicKey";
3131
+ const OS_DISK_SIZE_GB_PARAM = "osDiskSizeGb";
3132
+ function buildId$17(id) {
3133
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3134
+ }
3135
+ function buildVersion$17(major, minor, patch) {
3136
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3137
+ }
3138
+ function buildAzureVmType() {
3139
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_VM_TYPE_NAME).build()).build();
3140
+ }
3141
+ function pushParam$15(params, key, value) {
3142
+ params.push(key, value);
3143
+ }
3144
+ let AzureVm;
3145
+ (function(_AzureVm) {
3146
+ const getBuilder = _AzureVm.getBuilder = () => {
3147
+ const params = getParametersInstance();
3148
+ const inner = getLiveSystemComponentBuilder().withType(buildAzureVmType()).withParameters(params).withProvider("Azure");
3149
+ const builder = {
3150
+ withId: (id) => {
3151
+ inner.withId(buildId$17(id));
3152
+ return builder;
3153
+ },
3154
+ withVersion: (major, minor, patch) => {
3155
+ inner.withVersion(buildVersion$17(major, minor, patch));
3156
+ return builder;
3157
+ },
3158
+ withDisplayName: (displayName) => {
3159
+ inner.withDisplayName(displayName);
3160
+ return builder;
3161
+ },
3162
+ withDescription: (description) => {
3163
+ inner.withDescription(description);
3164
+ return builder;
3165
+ },
3166
+ withVmSize: (value) => {
3167
+ pushParam$15(params, VM_SIZE_PARAM, value);
3168
+ return builder;
3169
+ },
3170
+ withLocation: (value) => {
3171
+ pushParam$15(params, LOCATION_PARAM$1, value);
3172
+ return builder;
3173
+ },
3174
+ withResourceGroup: (value) => {
3175
+ pushParam$15(params, RESOURCE_GROUP_PARAM, value);
3176
+ return builder;
3177
+ },
3178
+ withAdminUsername: (value) => {
3179
+ pushParam$15(params, ADMIN_USERNAME_PARAM, value);
3180
+ return builder;
3181
+ },
3182
+ withImagePublisher: (value) => {
3183
+ pushParam$15(params, IMAGE_PUBLISHER_PARAM, value);
3184
+ return builder;
3185
+ },
3186
+ withImageOffer: (value) => {
3187
+ pushParam$15(params, IMAGE_OFFER_PARAM, value);
3188
+ return builder;
3189
+ },
3190
+ withImageSku: (value) => {
3191
+ pushParam$15(params, IMAGE_SKU_PARAM, value);
3192
+ return builder;
3193
+ },
3194
+ withSshPublicKey: (value) => {
3195
+ pushParam$15(params, SSH_PUBLIC_KEY_PARAM$1, value);
3196
+ return builder;
3197
+ },
3198
+ withOsDiskSizeGb: (value) => {
3199
+ pushParam$15(params, OS_DISK_SIZE_GB_PARAM, value);
3200
+ return builder;
3201
+ },
3202
+ build: () => inner.build()
3203
+ };
3204
+ return builder;
3205
+ };
3206
+ _AzureVm.satisfy = (blueprint) => {
3207
+ const params = getParametersInstance();
3208
+ 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);
3209
+ if (blueprint.description) inner.withDescription(blueprint.description);
3210
+ const satisfiedBuilder = {
3211
+ withVmSize: (value) => {
3212
+ pushParam$15(params, VM_SIZE_PARAM, value);
3213
+ return satisfiedBuilder;
3214
+ },
3215
+ withLocation: (value) => {
3216
+ pushParam$15(params, LOCATION_PARAM$1, value);
3217
+ return satisfiedBuilder;
3218
+ },
3219
+ withResourceGroup: (value) => {
3220
+ pushParam$15(params, RESOURCE_GROUP_PARAM, value);
3221
+ return satisfiedBuilder;
3222
+ },
3223
+ withAdminUsername: (value) => {
3224
+ pushParam$15(params, ADMIN_USERNAME_PARAM, value);
3225
+ return satisfiedBuilder;
3226
+ },
3227
+ withImagePublisher: (value) => {
3228
+ pushParam$15(params, IMAGE_PUBLISHER_PARAM, value);
3229
+ return satisfiedBuilder;
3230
+ },
3231
+ withImageOffer: (value) => {
3232
+ pushParam$15(params, IMAGE_OFFER_PARAM, value);
3233
+ return satisfiedBuilder;
3234
+ },
3235
+ withImageSku: (value) => {
3236
+ pushParam$15(params, IMAGE_SKU_PARAM, value);
3237
+ return satisfiedBuilder;
3238
+ },
3239
+ withSshPublicKey: (value) => {
3240
+ pushParam$15(params, SSH_PUBLIC_KEY_PARAM$1, value);
3241
+ return satisfiedBuilder;
3242
+ },
3243
+ withOsDiskSizeGb: (value) => {
3244
+ pushParam$15(params, OS_DISK_SIZE_GB_PARAM, value);
3245
+ return satisfiedBuilder;
3246
+ },
3247
+ build: () => inner.build()
3248
+ };
3249
+ return satisfiedBuilder;
3250
+ };
3251
+ _AzureVm.create = (config) => {
3252
+ 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);
3253
+ if (config.description) b.withDescription(config.description);
3254
+ if (config.sshPublicKey) b.withSshPublicKey(config.sshPublicKey);
3255
+ if (config.osDiskSizeGb !== void 0) b.withOsDiskSizeGb(config.osDiskSizeGb);
3256
+ return b.build();
3257
+ };
3258
+ })(AzureVm || (AzureVm = {}));
3259
+
3260
+ //#endregion
3261
+ //#region src/live_system/component/network_and_compute/iaas/gcp_vpc.ts
3262
+ const GCP_VPC_TYPE_NAME = "GcpVpc";
3263
+ const AUTO_CREATE_SUBNETWORKS_PARAM = "autoCreateSubnetworks";
3264
+ const ROUTING_MODE_PARAM = "routingMode";
3265
+ function buildId$16(id) {
3266
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3267
+ }
3268
+ function buildVersion$16(major, minor, patch) {
3269
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3270
+ }
3271
+ function buildGcpVpcType() {
3272
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_VPC_TYPE_NAME).build()).build();
3273
+ }
3274
+ function pushParam$14(params, key, value) {
3275
+ params.push(key, value);
3276
+ }
3277
+ let GcpVpc;
3278
+ (function(_GcpVpc) {
3279
+ const getBuilder = _GcpVpc.getBuilder = () => {
3280
+ const params = getParametersInstance();
3281
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpVpcType()).withParameters(params).withProvider("GCP");
3282
+ const builder = {
3283
+ withId: (id) => {
3284
+ inner.withId(buildId$16(id));
3285
+ return builder;
3286
+ },
3287
+ withVersion: (major, minor, patch) => {
3288
+ inner.withVersion(buildVersion$16(major, minor, patch));
3289
+ return builder;
3290
+ },
3291
+ withDisplayName: (displayName) => {
3292
+ inner.withDisplayName(displayName);
3293
+ return builder;
3294
+ },
3295
+ withDescription: (description) => {
3296
+ inner.withDescription(description);
3297
+ return builder;
3298
+ },
3299
+ withCidrBlock: (value) => {
3300
+ pushParam$14(params, CIDR_BLOCK_PARAM$1, value);
3301
+ return builder;
3302
+ },
3303
+ withAutoCreateSubnetworks: (value) => {
3304
+ pushParam$14(params, AUTO_CREATE_SUBNETWORKS_PARAM, value);
3305
+ return builder;
3306
+ },
3307
+ withRoutingMode: (value) => {
3308
+ pushParam$14(params, ROUTING_MODE_PARAM, value);
3309
+ return builder;
3310
+ },
3311
+ build: () => inner.build()
3312
+ };
3313
+ return builder;
3314
+ };
3315
+ _GcpVpc.satisfy = (blueprint) => {
3316
+ const params = getParametersInstance();
3317
+ 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);
3318
+ if (blueprint.description) inner.withDescription(blueprint.description);
3319
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
3320
+ if (cidrBlock !== null) pushParam$14(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
3321
+ const satisfiedBuilder = {
3322
+ withAutoCreateSubnetworks: (value) => {
3323
+ pushParam$14(params, AUTO_CREATE_SUBNETWORKS_PARAM, value);
3324
+ return satisfiedBuilder;
3325
+ },
3326
+ withRoutingMode: (value) => {
3327
+ pushParam$14(params, ROUTING_MODE_PARAM, value);
3328
+ return satisfiedBuilder;
3329
+ },
3330
+ build: () => inner.build()
3331
+ };
3332
+ return satisfiedBuilder;
3333
+ };
3334
+ _GcpVpc.create = (config) => {
3335
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock);
3336
+ if (config.description) b.withDescription(config.description);
3337
+ if (config.autoCreateSubnetworks !== void 0) b.withAutoCreateSubnetworks(config.autoCreateSubnetworks);
3338
+ if (config.routingMode) b.withRoutingMode(config.routingMode);
3339
+ return b.build();
3340
+ };
3341
+ })(GcpVpc || (GcpVpc = {}));
3342
+
3343
+ //#endregion
3344
+ //#region src/live_system/component/network_and_compute/iaas/gcp_subnet.ts
3345
+ const GCP_SUBNET_TYPE_NAME = "GcpSubnet";
3346
+ const REGION_PARAM = "region";
3347
+ const PRIVATE_IP_GOOGLE_ACCESS_PARAM = "privateIpGoogleAccess";
3348
+ function buildId$15(id) {
3349
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3350
+ }
3351
+ function buildVersion$15(major, minor, patch) {
3352
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3353
+ }
3354
+ function buildGcpSubnetType() {
3355
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_SUBNET_TYPE_NAME).build()).build();
3356
+ }
3357
+ function pushParam$13(params, key, value) {
3358
+ params.push(key, value);
3359
+ }
3360
+ let GcpSubnet;
3361
+ (function(_GcpSubnet) {
3362
+ const getBuilder = _GcpSubnet.getBuilder = () => {
3363
+ const params = getParametersInstance();
3364
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpSubnetType()).withParameters(params).withProvider("GCP");
3365
+ const builder = {
3366
+ withId: (id) => {
3367
+ inner.withId(buildId$15(id));
3368
+ return builder;
3369
+ },
3370
+ withVersion: (major, minor, patch) => {
3371
+ inner.withVersion(buildVersion$15(major, minor, patch));
3372
+ return builder;
3373
+ },
3374
+ withDisplayName: (displayName) => {
3375
+ inner.withDisplayName(displayName);
3376
+ return builder;
3377
+ },
3378
+ withDescription: (description) => {
3379
+ inner.withDescription(description);
3380
+ return builder;
3381
+ },
3382
+ withCidrBlock: (value) => {
3383
+ pushParam$13(params, CIDR_BLOCK_PARAM, value);
3384
+ return builder;
3385
+ },
3386
+ withRegion: (value) => {
3387
+ pushParam$13(params, REGION_PARAM, value);
3388
+ return builder;
3389
+ },
3390
+ withPrivateIpGoogleAccess: (value) => {
3391
+ pushParam$13(params, PRIVATE_IP_GOOGLE_ACCESS_PARAM, value);
3392
+ return builder;
3393
+ },
3394
+ build: () => inner.build()
3395
+ };
3396
+ return builder;
3397
+ };
3398
+ _GcpSubnet.satisfy = (blueprint) => {
3399
+ const params = getParametersInstance();
3400
+ 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);
3401
+ if (blueprint.description) inner.withDescription(blueprint.description);
3402
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
3403
+ if (cidrBlock !== null) pushParam$13(params, CIDR_BLOCK_PARAM, String(cidrBlock));
3404
+ const satisfiedBuilder = {
3405
+ withRegion: (value) => {
3406
+ pushParam$13(params, REGION_PARAM, value);
3407
+ return satisfiedBuilder;
3408
+ },
3409
+ withPrivateIpGoogleAccess: (value) => {
3410
+ pushParam$13(params, PRIVATE_IP_GOOGLE_ACCESS_PARAM, value);
3411
+ return satisfiedBuilder;
3412
+ },
3413
+ build: () => inner.build()
3414
+ };
3415
+ return satisfiedBuilder;
3416
+ };
3417
+ _GcpSubnet.create = (config) => {
3418
+ 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);
3419
+ if (config.description) b.withDescription(config.description);
3420
+ if (config.privateIpGoogleAccess !== void 0) b.withPrivateIpGoogleAccess(config.privateIpGoogleAccess);
3421
+ return b.build();
3422
+ };
3423
+ })(GcpSubnet || (GcpSubnet = {}));
3424
+
3425
+ //#endregion
3426
+ //#region src/live_system/component/network_and_compute/iaas/gcp_firewall.ts
3427
+ const GCP_FIREWALL_TYPE_NAME = "GcpFirewall";
3428
+ function buildId$14(id) {
3429
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3430
+ }
3431
+ function buildVersion$14(major, minor, patch) {
3432
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3433
+ }
3434
+ function buildGcpFirewallType() {
3435
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_FIREWALL_TYPE_NAME).build()).build();
3436
+ }
3437
+ function pushParam$12(params, key, value) {
3438
+ params.push(key, value);
3439
+ }
3440
+ let GcpFirewall;
3441
+ (function(_GcpFirewall) {
3442
+ const getBuilder = _GcpFirewall.getBuilder = () => {
3443
+ const params = getParametersInstance();
3444
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpFirewallType()).withParameters(params).withProvider("GCP");
3445
+ const builder = {
3446
+ withId: (id) => {
3447
+ inner.withId(buildId$14(id));
3448
+ return builder;
3449
+ },
3450
+ withVersion: (major, minor, patch) => {
3451
+ inner.withVersion(buildVersion$14(major, minor, patch));
3452
+ return builder;
3453
+ },
3454
+ withDisplayName: (displayName) => {
3455
+ inner.withDisplayName(displayName);
3456
+ return builder;
3457
+ },
3458
+ withDescription: (description) => {
3459
+ inner.withDescription(description);
3460
+ pushParam$12(params, DESCRIPTION_PARAM, description);
3461
+ return builder;
3462
+ },
3463
+ withIngressRules: (rules) => {
3464
+ pushParam$12(params, INGRESS_RULES_PARAM, rules);
3465
+ return builder;
3466
+ },
3467
+ build: () => inner.build()
3468
+ };
3469
+ return builder;
3470
+ };
3471
+ _GcpFirewall.satisfy = (blueprint) => {
3472
+ const params = getParametersInstance();
3473
+ 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);
3474
+ const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
3475
+ if (description !== null) {
3476
+ inner.withDescription(String(description));
3477
+ pushParam$12(params, DESCRIPTION_PARAM, String(description));
3478
+ } else if (blueprint.description) inner.withDescription(blueprint.description);
3479
+ const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
3480
+ if (ingressRules !== null) pushParam$12(params, INGRESS_RULES_PARAM, ingressRules);
3481
+ return { build: () => inner.build() };
3482
+ };
3483
+ _GcpFirewall.create = (config) => {
3484
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
3485
+ if (config.description) b.withDescription(config.description);
3486
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
3487
+ return b.build();
3488
+ };
3489
+ })(GcpFirewall || (GcpFirewall = {}));
3490
+
3491
+ //#endregion
3492
+ //#region src/live_system/component/network_and_compute/iaas/gcp_vm.ts
3493
+ const GCP_VM_TYPE_NAME = "GcpVm";
3494
+ const MACHINE_TYPE_PARAM = "machineType";
3495
+ const ZONE_PARAM = "zone";
3496
+ const IMAGE_PROJECT_PARAM = "imageProject";
3497
+ const IMAGE_FAMILY_PARAM = "imageFamily";
3498
+ const SERVICE_ACCOUNT_EMAIL_PARAM = "serviceAccountEmail";
3499
+ function buildId$13(id) {
3500
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3501
+ }
3502
+ function buildVersion$13(major, minor, patch) {
3503
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3504
+ }
3505
+ function buildGcpVmType() {
3506
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_VM_TYPE_NAME).build()).build();
3507
+ }
3508
+ function pushParam$11(params, key, value) {
3509
+ params.push(key, value);
3510
+ }
3511
+ let GcpVm;
3512
+ (function(_GcpVm) {
3513
+ const getBuilder = _GcpVm.getBuilder = () => {
3514
+ const params = getParametersInstance();
3515
+ const inner = getLiveSystemComponentBuilder().withType(buildGcpVmType()).withParameters(params).withProvider("GCP");
3516
+ const builder = {
3517
+ withId: (id) => {
3518
+ inner.withId(buildId$13(id));
3519
+ return builder;
3520
+ },
3521
+ withVersion: (major, minor, patch) => {
3522
+ inner.withVersion(buildVersion$13(major, minor, patch));
3523
+ return builder;
3524
+ },
3525
+ withDisplayName: (displayName) => {
3526
+ inner.withDisplayName(displayName);
3527
+ return builder;
3528
+ },
3529
+ withDescription: (description) => {
3530
+ inner.withDescription(description);
3531
+ return builder;
3532
+ },
3533
+ withMachineType: (value) => {
3534
+ pushParam$11(params, MACHINE_TYPE_PARAM, value);
3535
+ return builder;
3536
+ },
3537
+ withZone: (value) => {
3538
+ pushParam$11(params, ZONE_PARAM, value);
3539
+ return builder;
3540
+ },
3541
+ withImageProject: (value) => {
3542
+ pushParam$11(params, IMAGE_PROJECT_PARAM, value);
3543
+ return builder;
3544
+ },
3545
+ withImageFamily: (value) => {
3546
+ pushParam$11(params, IMAGE_FAMILY_PARAM, value);
3547
+ return builder;
3548
+ },
3549
+ withServiceAccountEmail: (value) => {
3550
+ pushParam$11(params, SERVICE_ACCOUNT_EMAIL_PARAM, value);
3551
+ return builder;
3552
+ },
3553
+ build: () => inner.build()
3554
+ };
3555
+ return builder;
3556
+ };
3557
+ _GcpVm.satisfy = (blueprint) => {
3558
+ const params = getParametersInstance();
3559
+ 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);
3560
+ if (blueprint.description) inner.withDescription(blueprint.description);
3561
+ const satisfiedBuilder = {
3562
+ withMachineType: (value) => {
3563
+ pushParam$11(params, MACHINE_TYPE_PARAM, value);
3564
+ return satisfiedBuilder;
3565
+ },
3566
+ withZone: (value) => {
3567
+ pushParam$11(params, ZONE_PARAM, value);
3568
+ return satisfiedBuilder;
3569
+ },
3570
+ withImageProject: (value) => {
3571
+ pushParam$11(params, IMAGE_PROJECT_PARAM, value);
3572
+ return satisfiedBuilder;
3573
+ },
3574
+ withImageFamily: (value) => {
3575
+ pushParam$11(params, IMAGE_FAMILY_PARAM, value);
3576
+ return satisfiedBuilder;
3577
+ },
3578
+ withServiceAccountEmail: (value) => {
3579
+ pushParam$11(params, SERVICE_ACCOUNT_EMAIL_PARAM, value);
3580
+ return satisfiedBuilder;
3581
+ },
3582
+ build: () => inner.build()
3583
+ };
3584
+ return satisfiedBuilder;
3585
+ };
3586
+ _GcpVm.create = (config) => {
3587
+ 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);
3588
+ if (config.description) b.withDescription(config.description);
3589
+ if (config.imageFamily) b.withImageFamily(config.imageFamily);
3590
+ if (config.serviceAccountEmail) b.withServiceAccountEmail(config.serviceAccountEmail);
3591
+ return b.build();
3592
+ };
3593
+ })(GcpVm || (GcpVm = {}));
3594
+
3595
+ //#endregion
3596
+ //#region src/live_system/component/network_and_compute/iaas/oci_vcn.ts
3597
+ const OCI_VCN_TYPE_NAME = "OciVcn";
3598
+ const COMPARTMENT_ID_PARAM$3 = "compartmentId";
3599
+ function buildId$12(id) {
3600
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3601
+ }
3602
+ function buildVersion$12(major, minor, patch) {
3603
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3604
+ }
3605
+ function buildOciVcnType() {
3606
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_VCN_TYPE_NAME).build()).build();
3607
+ }
3608
+ function pushParam$10(params, key, value) {
3609
+ params.push(key, value);
3610
+ }
3611
+ let OciVcn;
3612
+ (function(_OciVcn) {
3613
+ const getBuilder = _OciVcn.getBuilder = () => {
3614
+ const params = getParametersInstance();
3615
+ const inner = getLiveSystemComponentBuilder().withType(buildOciVcnType()).withParameters(params).withProvider("OCI");
3616
+ const builder = {
3617
+ withId: (id) => {
3618
+ inner.withId(buildId$12(id));
3619
+ return builder;
3620
+ },
3621
+ withVersion: (major, minor, patch) => {
3622
+ inner.withVersion(buildVersion$12(major, minor, patch));
3623
+ return builder;
3624
+ },
3625
+ withDisplayName: (displayName) => {
3626
+ inner.withDisplayName(displayName);
3627
+ return builder;
3628
+ },
3629
+ withDescription: (description) => {
3630
+ inner.withDescription(description);
3631
+ return builder;
3632
+ },
3633
+ withCidrBlock: (value) => {
3634
+ pushParam$10(params, CIDR_BLOCK_PARAM$1, value);
3635
+ return builder;
3636
+ },
3637
+ withCompartmentId: (value) => {
3638
+ pushParam$10(params, COMPARTMENT_ID_PARAM$3, value);
3639
+ return builder;
3640
+ },
3641
+ build: () => inner.build()
3642
+ };
3643
+ return builder;
3644
+ };
3645
+ _OciVcn.satisfy = (blueprint) => {
3646
+ const params = getParametersInstance();
3647
+ 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);
3648
+ if (blueprint.description) inner.withDescription(blueprint.description);
3649
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
3650
+ if (cidrBlock !== null) pushParam$10(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
3651
+ const satisfiedBuilder = {
3652
+ withCompartmentId: (value) => {
3653
+ pushParam$10(params, COMPARTMENT_ID_PARAM$3, value);
3654
+ return satisfiedBuilder;
3655
+ },
3656
+ build: () => inner.build()
3657
+ };
3658
+ return satisfiedBuilder;
3659
+ };
3660
+ _OciVcn.create = (config) => {
3661
+ 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);
3662
+ if (config.description) b.withDescription(config.description);
3663
+ return b.build();
3664
+ };
3665
+ })(OciVcn || (OciVcn = {}));
3666
+
3667
+ //#endregion
3668
+ //#region src/live_system/component/network_and_compute/iaas/oci_subnet.ts
3669
+ const OCI_SUBNET_TYPE_NAME = "OciSubnet";
3670
+ const COMPARTMENT_ID_PARAM$2 = "compartmentId";
3671
+ const AVAILABILITY_DOMAIN_PARAM$1 = "availabilityDomain";
3672
+ const PROHIBIT_PUBLIC_IP_PARAM = "prohibitPublicIpOnVnic";
3673
+ function buildId$11(id) {
3674
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3675
+ }
3676
+ function buildVersion$11(major, minor, patch) {
3677
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3678
+ }
3679
+ function buildOciSubnetType() {
3680
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_SUBNET_TYPE_NAME).build()).build();
3681
+ }
3682
+ function pushParam$9(params, key, value) {
3683
+ params.push(key, value);
3684
+ }
3685
+ let OciSubnet;
3686
+ (function(_OciSubnet) {
3687
+ const getBuilder = _OciSubnet.getBuilder = () => {
3688
+ const params = getParametersInstance();
3689
+ const inner = getLiveSystemComponentBuilder().withType(buildOciSubnetType()).withParameters(params).withProvider("OCI");
3690
+ const builder = {
3691
+ withId: (id) => {
3692
+ inner.withId(buildId$11(id));
3693
+ return builder;
3694
+ },
3695
+ withVersion: (major, minor, patch) => {
3696
+ inner.withVersion(buildVersion$11(major, minor, patch));
3697
+ return builder;
3698
+ },
3699
+ withDisplayName: (displayName) => {
3700
+ inner.withDisplayName(displayName);
3701
+ return builder;
3702
+ },
3703
+ withDescription: (description) => {
3704
+ inner.withDescription(description);
3705
+ return builder;
3706
+ },
3707
+ withCidrBlock: (value) => {
3708
+ pushParam$9(params, CIDR_BLOCK_PARAM, value);
3709
+ return builder;
3710
+ },
3711
+ withCompartmentId: (value) => {
3712
+ pushParam$9(params, COMPARTMENT_ID_PARAM$2, value);
3713
+ return builder;
3714
+ },
3715
+ withAvailabilityDomain: (value) => {
3716
+ pushParam$9(params, AVAILABILITY_DOMAIN_PARAM$1, value);
3717
+ return builder;
3718
+ },
3719
+ withProhibitPublicIpOnVnic: (value) => {
3720
+ pushParam$9(params, PROHIBIT_PUBLIC_IP_PARAM, value);
3721
+ return builder;
3722
+ },
3723
+ build: () => inner.build()
3724
+ };
3725
+ return builder;
3726
+ };
3727
+ _OciSubnet.satisfy = (blueprint) => {
3728
+ const params = getParametersInstance();
3729
+ 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);
3730
+ if (blueprint.description) inner.withDescription(blueprint.description);
3731
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
3732
+ if (cidrBlock !== null) pushParam$9(params, CIDR_BLOCK_PARAM, String(cidrBlock));
3733
+ const satisfiedBuilder = {
3734
+ withCompartmentId: (value) => {
3735
+ pushParam$9(params, COMPARTMENT_ID_PARAM$2, value);
3736
+ return satisfiedBuilder;
3737
+ },
3738
+ withAvailabilityDomain: (value) => {
3739
+ pushParam$9(params, AVAILABILITY_DOMAIN_PARAM$1, value);
3740
+ return satisfiedBuilder;
3741
+ },
3742
+ withProhibitPublicIpOnVnic: (value) => {
3743
+ pushParam$9(params, PROHIBIT_PUBLIC_IP_PARAM, value);
3744
+ return satisfiedBuilder;
3745
+ },
3746
+ build: () => inner.build()
3747
+ };
3748
+ return satisfiedBuilder;
3749
+ };
3750
+ _OciSubnet.create = (config) => {
3751
+ 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);
3752
+ if (config.description) b.withDescription(config.description);
3753
+ if (config.availabilityDomain) b.withAvailabilityDomain(config.availabilityDomain);
3754
+ if (config.prohibitPublicIpOnVnic !== void 0) b.withProhibitPublicIpOnVnic(config.prohibitPublicIpOnVnic);
3755
+ return b.build();
3756
+ };
3757
+ })(OciSubnet || (OciSubnet = {}));
3758
+
3759
+ //#endregion
3760
+ //#region src/live_system/component/network_and_compute/iaas/oci_security_list.ts
3761
+ const OCI_SECURITY_LIST_TYPE_NAME = "OciSecurityList";
3762
+ const COMPARTMENT_ID_PARAM$1 = "compartmentId";
3763
+ function buildId$10(id) {
3764
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3765
+ }
3766
+ function buildVersion$10(major, minor, patch) {
3767
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3768
+ }
3769
+ function buildOciSecurityListType() {
3770
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_SECURITY_LIST_TYPE_NAME).build()).build();
3771
+ }
3772
+ function pushParam$8(params, key, value) {
3773
+ params.push(key, value);
3774
+ }
3775
+ let OciSecurityList;
3776
+ (function(_OciSecurityList) {
3777
+ const getBuilder = _OciSecurityList.getBuilder = () => {
3778
+ const params = getParametersInstance();
3779
+ const inner = getLiveSystemComponentBuilder().withType(buildOciSecurityListType()).withParameters(params).withProvider("OCI");
3780
+ const builder = {
3781
+ withId: (id) => {
3782
+ inner.withId(buildId$10(id));
3783
+ return builder;
3784
+ },
3785
+ withVersion: (major, minor, patch) => {
3786
+ inner.withVersion(buildVersion$10(major, minor, patch));
3787
+ return builder;
3788
+ },
3789
+ withDisplayName: (displayName) => {
3790
+ inner.withDisplayName(displayName);
3791
+ return builder;
3792
+ },
3793
+ withDescription: (description) => {
3794
+ inner.withDescription(description);
3795
+ pushParam$8(params, DESCRIPTION_PARAM, description);
3796
+ return builder;
3797
+ },
3798
+ withIngressRules: (rules) => {
3799
+ pushParam$8(params, INGRESS_RULES_PARAM, rules);
3800
+ return builder;
3801
+ },
3802
+ withCompartmentId: (value) => {
3803
+ pushParam$8(params, COMPARTMENT_ID_PARAM$1, value);
3804
+ return builder;
3805
+ },
3806
+ build: () => inner.build()
3807
+ };
3808
+ return builder;
3809
+ };
3810
+ _OciSecurityList.satisfy = (blueprint) => {
3811
+ const params = getParametersInstance();
3812
+ 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);
3813
+ const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
3814
+ if (description !== null) {
3815
+ inner.withDescription(String(description));
3816
+ pushParam$8(params, DESCRIPTION_PARAM, String(description));
3817
+ } else if (blueprint.description) inner.withDescription(blueprint.description);
3818
+ const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
3819
+ if (ingressRules !== null) pushParam$8(params, INGRESS_RULES_PARAM, ingressRules);
3820
+ const satisfiedBuilder = {
3821
+ withCompartmentId: (value) => {
3822
+ pushParam$8(params, COMPARTMENT_ID_PARAM$1, value);
3823
+ return satisfiedBuilder;
3824
+ },
3825
+ build: () => inner.build()
3826
+ };
3827
+ return satisfiedBuilder;
3828
+ };
3829
+ _OciSecurityList.create = (config) => {
3830
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCompartmentId(config.compartmentId);
3831
+ if (config.description) b.withDescription(config.description);
3832
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
3833
+ return b.build();
3834
+ };
3835
+ })(OciSecurityList || (OciSecurityList = {}));
3836
+
3837
+ //#endregion
3838
+ //#region src/live_system/component/network_and_compute/iaas/oci_instance.ts
3839
+ const OCI_INSTANCE_TYPE_NAME = "OciInstance";
3840
+ const COMPARTMENT_ID_PARAM = "compartmentId";
3841
+ const AVAILABILITY_DOMAIN_PARAM = "availabilityDomain";
3842
+ const SHAPE_PARAM = "shape";
3843
+ const IMAGE_ID_PARAM = "imageId";
3844
+ const OCPUS_PARAM = "ocpus";
3845
+ const MEMORY_IN_GBS_PARAM = "memoryInGbs";
3846
+ const SSH_PUBLIC_KEY_PARAM = "sshPublicKey";
3847
+ function buildId$9(id) {
3848
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3849
+ }
3850
+ function buildVersion$9(major, minor, patch) {
3851
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3852
+ }
3853
+ function buildOciInstanceType() {
3854
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_INSTANCE_TYPE_NAME).build()).build();
3855
+ }
3856
+ function pushParam$7(params, key, value) {
3857
+ params.push(key, value);
3858
+ }
3859
+ let OciInstance;
3860
+ (function(_OciInstance) {
3861
+ const getBuilder = _OciInstance.getBuilder = () => {
3862
+ const params = getParametersInstance();
3863
+ const inner = getLiveSystemComponentBuilder().withType(buildOciInstanceType()).withParameters(params).withProvider("OCI");
3864
+ const builder = {
3865
+ withId: (id) => {
3866
+ inner.withId(buildId$9(id));
3867
+ return builder;
3868
+ },
3869
+ withVersion: (major, minor, patch) => {
3870
+ inner.withVersion(buildVersion$9(major, minor, patch));
3871
+ return builder;
3872
+ },
3873
+ withDisplayName: (displayName) => {
3874
+ inner.withDisplayName(displayName);
3875
+ return builder;
3876
+ },
3877
+ withDescription: (description) => {
3878
+ inner.withDescription(description);
3879
+ return builder;
3880
+ },
3881
+ withCompartmentId: (value) => {
3882
+ pushParam$7(params, COMPARTMENT_ID_PARAM, value);
3883
+ return builder;
3884
+ },
3885
+ withAvailabilityDomain: (value) => {
3886
+ pushParam$7(params, AVAILABILITY_DOMAIN_PARAM, value);
3887
+ return builder;
3888
+ },
3889
+ withShape: (value) => {
3890
+ pushParam$7(params, SHAPE_PARAM, value);
3891
+ return builder;
3892
+ },
3893
+ withImageId: (value) => {
3894
+ pushParam$7(params, IMAGE_ID_PARAM, value);
3895
+ return builder;
3896
+ },
3897
+ withOcpus: (value) => {
3898
+ pushParam$7(params, OCPUS_PARAM, value);
3899
+ return builder;
3900
+ },
3901
+ withMemoryInGbs: (value) => {
3902
+ pushParam$7(params, MEMORY_IN_GBS_PARAM, value);
3903
+ return builder;
3904
+ },
3905
+ withSshPublicKey: (value) => {
3906
+ pushParam$7(params, SSH_PUBLIC_KEY_PARAM, value);
3907
+ return builder;
3908
+ },
3909
+ build: () => inner.build()
3910
+ };
3911
+ return builder;
3912
+ };
3913
+ _OciInstance.satisfy = (blueprint) => {
3914
+ const params = getParametersInstance();
3915
+ 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);
3916
+ if (blueprint.description) inner.withDescription(blueprint.description);
3917
+ const satisfiedBuilder = {
3918
+ withCompartmentId: (value) => {
3919
+ pushParam$7(params, COMPARTMENT_ID_PARAM, value);
3920
+ return satisfiedBuilder;
3921
+ },
3922
+ withAvailabilityDomain: (value) => {
3923
+ pushParam$7(params, AVAILABILITY_DOMAIN_PARAM, value);
3924
+ return satisfiedBuilder;
3925
+ },
3926
+ withShape: (value) => {
3927
+ pushParam$7(params, SHAPE_PARAM, value);
3928
+ return satisfiedBuilder;
3929
+ },
3930
+ withImageId: (value) => {
3931
+ pushParam$7(params, IMAGE_ID_PARAM, value);
3932
+ return satisfiedBuilder;
3933
+ },
3934
+ withOcpus: (value) => {
3935
+ pushParam$7(params, OCPUS_PARAM, value);
3936
+ return satisfiedBuilder;
3937
+ },
3938
+ withMemoryInGbs: (value) => {
3939
+ pushParam$7(params, MEMORY_IN_GBS_PARAM, value);
3940
+ return satisfiedBuilder;
3941
+ },
3942
+ withSshPublicKey: (value) => {
3943
+ pushParam$7(params, SSH_PUBLIC_KEY_PARAM, value);
3944
+ return satisfiedBuilder;
3945
+ },
3946
+ build: () => inner.build()
3947
+ };
3948
+ return satisfiedBuilder;
3949
+ };
3950
+ _OciInstance.create = (config) => {
3951
+ 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);
3952
+ if (config.description) b.withDescription(config.description);
3953
+ if (config.ocpus !== void 0) b.withOcpus(config.ocpus);
3954
+ if (config.memoryInGbs !== void 0) b.withMemoryInGbs(config.memoryInGbs);
3955
+ if (config.sshPublicKey) b.withSshPublicKey(config.sshPublicKey);
3956
+ return b.build();
3957
+ };
3958
+ })(OciInstance || (OciInstance = {}));
3959
+
3960
+ //#endregion
3961
+ //#region src/live_system/component/network_and_compute/iaas/hetzner_network.ts
3962
+ const HETZNER_NETWORK_TYPE_NAME = "HetznerNetwork";
3963
+ function buildId$8(id) {
3964
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
3965
+ }
3966
+ function buildVersion$8(major, minor, patch) {
3967
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
3968
+ }
3969
+ function buildHetznerNetworkType() {
3970
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_NETWORK_TYPE_NAME).build()).build();
3971
+ }
3972
+ function pushParam$6(params, key, value) {
3973
+ params.push(key, value);
3974
+ }
3975
+ let HetznerNetwork;
3976
+ (function(_HetznerNetwork) {
3977
+ const getBuilder = _HetznerNetwork.getBuilder = () => {
3978
+ const params = getParametersInstance();
3979
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerNetworkType()).withParameters(params).withProvider("Hetzner");
3980
+ const builder = {
3981
+ withId: (id) => {
3982
+ inner.withId(buildId$8(id));
3983
+ return builder;
3984
+ },
3985
+ withVersion: (major, minor, patch) => {
3986
+ inner.withVersion(buildVersion$8(major, minor, patch));
3987
+ return builder;
3988
+ },
3989
+ withDisplayName: (displayName) => {
3990
+ inner.withDisplayName(displayName);
3991
+ return builder;
3992
+ },
3993
+ withDescription: (description) => {
3994
+ inner.withDescription(description);
3995
+ return builder;
3996
+ },
3997
+ withCidrBlock: (value) => {
3998
+ pushParam$6(params, CIDR_BLOCK_PARAM$1, value);
3999
+ return builder;
4000
+ },
4001
+ build: () => inner.build()
4002
+ };
4003
+ return builder;
4004
+ };
4005
+ _HetznerNetwork.satisfy = (blueprint) => {
4006
+ const params = getParametersInstance();
4007
+ 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);
4008
+ if (blueprint.description) inner.withDescription(blueprint.description);
4009
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
4010
+ if (cidrBlock !== null) pushParam$6(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
4011
+ return { build: () => inner.build() };
4012
+ };
4013
+ _HetznerNetwork.create = (config) => {
4014
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock);
4015
+ if (config.description) b.withDescription(config.description);
4016
+ return b.build();
4017
+ };
4018
+ })(HetznerNetwork || (HetznerNetwork = {}));
4019
+
4020
+ //#endregion
4021
+ //#region src/live_system/component/network_and_compute/iaas/hetzner_subnet.ts
4022
+ const HETZNER_SUBNET_TYPE_NAME = "HetznerSubnet";
4023
+ const NETWORK_ZONE_PARAM = "networkZone";
4024
+ const TYPE_PARAM = "type";
4025
+ function buildId$7(id) {
4026
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4027
+ }
4028
+ function buildVersion$7(major, minor, patch) {
4029
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4030
+ }
4031
+ function buildHetznerSubnetType() {
4032
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_SUBNET_TYPE_NAME).build()).build();
4033
+ }
4034
+ function pushParam$5(params, key, value) {
4035
+ params.push(key, value);
4036
+ }
4037
+ let HetznerSubnet;
4038
+ (function(_HetznerSubnet) {
4039
+ const getBuilder = _HetznerSubnet.getBuilder = () => {
4040
+ const params = getParametersInstance();
4041
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerSubnetType()).withParameters(params).withProvider("Hetzner");
4042
+ const builder = {
4043
+ withId: (id) => {
4044
+ inner.withId(buildId$7(id));
4045
+ return builder;
4046
+ },
4047
+ withVersion: (major, minor, patch) => {
4048
+ inner.withVersion(buildVersion$7(major, minor, patch));
4049
+ return builder;
4050
+ },
4051
+ withDisplayName: (displayName) => {
4052
+ inner.withDisplayName(displayName);
4053
+ return builder;
4054
+ },
4055
+ withDescription: (description) => {
4056
+ inner.withDescription(description);
4057
+ return builder;
4058
+ },
4059
+ withCidrBlock: (value) => {
4060
+ pushParam$5(params, CIDR_BLOCK_PARAM, value);
4061
+ return builder;
4062
+ },
4063
+ withNetworkZone: (value) => {
4064
+ pushParam$5(params, NETWORK_ZONE_PARAM, value);
4065
+ return builder;
4066
+ },
4067
+ withType: (value) => {
4068
+ pushParam$5(params, TYPE_PARAM, value);
4069
+ return builder;
4070
+ },
4071
+ build: () => inner.build()
4072
+ };
4073
+ return builder;
4074
+ };
4075
+ _HetznerSubnet.satisfy = (blueprint) => {
4076
+ const params = getParametersInstance();
4077
+ 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);
4078
+ if (blueprint.description) inner.withDescription(blueprint.description);
4079
+ const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
4080
+ if (cidrBlock !== null) pushParam$5(params, CIDR_BLOCK_PARAM, String(cidrBlock));
4081
+ const satisfiedBuilder = {
4082
+ withNetworkZone: (value) => {
4083
+ pushParam$5(params, NETWORK_ZONE_PARAM, value);
4084
+ return satisfiedBuilder;
4085
+ },
4086
+ withType: (value) => {
4087
+ pushParam$5(params, TYPE_PARAM, value);
4088
+ return satisfiedBuilder;
4089
+ },
4090
+ build: () => inner.build()
4091
+ };
4092
+ return satisfiedBuilder;
4093
+ };
4094
+ _HetznerSubnet.create = (config) => {
4095
+ 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);
4096
+ if (config.description) b.withDescription(config.description);
4097
+ if (config.type) b.withType(config.type);
4098
+ return b.build();
4099
+ };
4100
+ })(HetznerSubnet || (HetznerSubnet = {}));
4101
+
4102
+ //#endregion
4103
+ //#region src/live_system/component/network_and_compute/iaas/hetzner_firewall.ts
4104
+ const HETZNER_FIREWALL_TYPE_NAME = "HetznerFirewall";
4105
+ function buildId$6(id) {
4106
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4107
+ }
4108
+ function buildVersion$6(major, minor, patch) {
4109
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4110
+ }
4111
+ function buildHetznerFirewallType() {
4112
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_FIREWALL_TYPE_NAME).build()).build();
4113
+ }
4114
+ function pushParam$4(params, key, value) {
4115
+ params.push(key, value);
4116
+ }
4117
+ let HetznerFirewall;
4118
+ (function(_HetznerFirewall) {
4119
+ const getBuilder = _HetznerFirewall.getBuilder = () => {
4120
+ const params = getParametersInstance();
4121
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerFirewallType()).withParameters(params).withProvider("Hetzner");
4122
+ const builder = {
4123
+ withId: (id) => {
4124
+ inner.withId(buildId$6(id));
4125
+ return builder;
4126
+ },
4127
+ withVersion: (major, minor, patch) => {
4128
+ inner.withVersion(buildVersion$6(major, minor, patch));
4129
+ return builder;
4130
+ },
4131
+ withDisplayName: (displayName) => {
4132
+ inner.withDisplayName(displayName);
4133
+ return builder;
4134
+ },
4135
+ withDescription: (description) => {
4136
+ inner.withDescription(description);
4137
+ pushParam$4(params, DESCRIPTION_PARAM, description);
4138
+ return builder;
4139
+ },
4140
+ withIngressRules: (rules) => {
4141
+ pushParam$4(params, INGRESS_RULES_PARAM, rules);
4142
+ return builder;
4143
+ },
4144
+ build: () => inner.build()
4145
+ };
4146
+ return builder;
4147
+ };
4148
+ _HetznerFirewall.satisfy = (blueprint) => {
4149
+ const params = getParametersInstance();
4150
+ 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);
4151
+ const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
4152
+ if (description !== null) {
4153
+ inner.withDescription(String(description));
4154
+ pushParam$4(params, DESCRIPTION_PARAM, String(description));
4155
+ } else if (blueprint.description) inner.withDescription(blueprint.description);
4156
+ const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
4157
+ if (ingressRules !== null) pushParam$4(params, INGRESS_RULES_PARAM, ingressRules);
4158
+ return { build: () => inner.build() };
4159
+ };
4160
+ _HetznerFirewall.create = (config) => {
4161
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
4162
+ if (config.description) b.withDescription(config.description);
4163
+ if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
4164
+ return b.build();
4165
+ };
4166
+ })(HetznerFirewall || (HetznerFirewall = {}));
4167
+
4168
+ //#endregion
4169
+ //#region src/live_system/component/network_and_compute/iaas/hetzner_server.ts
4170
+ const HETZNER_SERVER_TYPE_NAME = "HetznerServer";
4171
+ const SERVER_TYPE_PARAM = "serverType";
4172
+ const LOCATION_PARAM = "location";
4173
+ const IMAGE_PARAM = "image";
4174
+ const SSH_KEYS_PARAM = "sshKeys";
4175
+ const USER_DATA_PARAM = "userData";
4176
+ function buildId$5(id) {
4177
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4178
+ }
4179
+ function buildVersion$5(major, minor, patch) {
4180
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4181
+ }
4182
+ function buildHetznerServerType() {
4183
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_SERVER_TYPE_NAME).build()).build();
4184
+ }
4185
+ function pushParam$3(params, key, value) {
4186
+ params.push(key, value);
4187
+ }
4188
+ let HetznerServer;
4189
+ (function(_HetznerServer) {
4190
+ const getBuilder = _HetznerServer.getBuilder = () => {
4191
+ const params = getParametersInstance();
4192
+ const inner = getLiveSystemComponentBuilder().withType(buildHetznerServerType()).withParameters(params).withProvider("Hetzner");
4193
+ const builder = {
4194
+ withId: (id) => {
4195
+ inner.withId(buildId$5(id));
4196
+ return builder;
4197
+ },
4198
+ withVersion: (major, minor, patch) => {
4199
+ inner.withVersion(buildVersion$5(major, minor, patch));
4200
+ return builder;
4201
+ },
4202
+ withDisplayName: (displayName) => {
4203
+ inner.withDisplayName(displayName);
4204
+ return builder;
4205
+ },
4206
+ withDescription: (description) => {
4207
+ inner.withDescription(description);
4208
+ return builder;
4209
+ },
4210
+ withServerType: (value) => {
4211
+ pushParam$3(params, SERVER_TYPE_PARAM, value);
4212
+ return builder;
4213
+ },
4214
+ withLocation: (value) => {
4215
+ pushParam$3(params, LOCATION_PARAM, value);
4216
+ return builder;
4217
+ },
4218
+ withImage: (value) => {
4219
+ pushParam$3(params, IMAGE_PARAM, value);
4220
+ return builder;
4221
+ },
4222
+ withSshKeys: (value) => {
4223
+ pushParam$3(params, SSH_KEYS_PARAM, value);
4224
+ return builder;
4225
+ },
4226
+ withUserData: (value) => {
4227
+ pushParam$3(params, USER_DATA_PARAM, value);
4228
+ return builder;
4229
+ },
4230
+ build: () => inner.build()
4231
+ };
4232
+ return builder;
4233
+ };
4234
+ _HetznerServer.satisfy = (blueprint) => {
4235
+ const params = getParametersInstance();
4236
+ 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);
4237
+ if (blueprint.description) inner.withDescription(blueprint.description);
4238
+ const satisfiedBuilder = {
4239
+ withServerType: (value) => {
4240
+ pushParam$3(params, SERVER_TYPE_PARAM, value);
4241
+ return satisfiedBuilder;
4242
+ },
4243
+ withLocation: (value) => {
4244
+ pushParam$3(params, LOCATION_PARAM, value);
4245
+ return satisfiedBuilder;
4246
+ },
4247
+ withImage: (value) => {
4248
+ pushParam$3(params, IMAGE_PARAM, value);
4249
+ return satisfiedBuilder;
4250
+ },
4251
+ withSshKeys: (value) => {
4252
+ pushParam$3(params, SSH_KEYS_PARAM, value);
4253
+ return satisfiedBuilder;
4254
+ },
4255
+ withUserData: (value) => {
4256
+ pushParam$3(params, USER_DATA_PARAM, value);
4257
+ return satisfiedBuilder;
4258
+ },
4259
+ build: () => inner.build()
4260
+ };
4261
+ return satisfiedBuilder;
4262
+ };
4263
+ _HetznerServer.create = (config) => {
4264
+ 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);
4265
+ if (config.description) b.withDescription(config.description);
4266
+ if (config.sshKeys && config.sshKeys.length > 0) b.withSshKeys(config.sshKeys);
4267
+ if (config.userData) b.withUserData(config.userData);
4268
+ return b.build();
4269
+ };
4270
+ })(HetznerServer || (HetznerServer = {}));
4271
+
4272
+ //#endregion
4273
+ //#region src/fractal/component/network_and_compute/paas/container_platform.ts
4274
+ const CONTAINER_PLATFORM_TYPE_NAME = "ContainerPlatform";
4275
+ function buildId$4(id) {
4276
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4277
+ }
4278
+ function buildVersion$4(major, minor, patch) {
4279
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4280
+ }
4281
+ function buildContainerPlatformType() {
4282
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(CONTAINER_PLATFORM_TYPE_NAME).build()).build();
4283
+ }
4284
+ function makeContainerPlatformComponent(platform, workloadNodes) {
4285
+ const platformDep = { id: platform.id };
4286
+ return {
4287
+ platform,
4288
+ workloads: workloadNodes.map((w) => ({
4289
+ ...w,
4290
+ component: {
4291
+ ...w.component,
4292
+ dependencies: [...w.component.dependencies, platformDep]
4293
+ }
4294
+ })),
4295
+ withWorkloads: (newWorkloads) => makeContainerPlatformComponent(platform, newWorkloads)
4296
+ };
4297
+ }
4298
+ let ContainerPlatform;
4299
+ (function(_ContainerPlatform) {
4300
+ const getBuilder = _ContainerPlatform.getBuilder = () => {
4301
+ const params = getParametersInstance();
4302
+ const inner = getBlueprintComponentBuilder().withType(buildContainerPlatformType()).withParameters(params);
4303
+ const builder = {
4304
+ withId: (id) => {
4305
+ inner.withId(buildId$4(id));
4306
+ return builder;
4307
+ },
4308
+ withVersion: (major, minor, patch) => {
4309
+ inner.withVersion(buildVersion$4(major, minor, patch));
4310
+ return builder;
4311
+ },
4312
+ withDisplayName: (displayName) => {
4313
+ inner.withDisplayName(displayName);
4314
+ return builder;
4315
+ },
4316
+ withDescription: (description) => {
4317
+ inner.withDescription(description);
4318
+ return builder;
4319
+ },
4320
+ build: () => inner.build()
4321
+ };
4322
+ return builder;
4323
+ };
4324
+ _ContainerPlatform.create = (config) => {
4325
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
4326
+ if (config.description) b.withDescription(config.description);
4327
+ return makeContainerPlatformComponent(b.build(), []);
4328
+ };
4329
+ })(ContainerPlatform || (ContainerPlatform = {}));
4330
+
4331
+ //#endregion
4332
+ //#region src/fractal/component/custom_workloads/caas/workload.ts
4333
+ const WORKLOAD_TYPE_NAME = "Workload";
4334
+ const CONTAINER_IMAGE_PARAM = "containerImage";
4335
+ const CONTAINER_PORT_PARAM = "containerPort";
4336
+ const CONTAINER_NAME_PARAM = "containerName";
4337
+ const CPU_PARAM = "cpu";
4338
+ const MEMORY_PARAM = "memory";
4339
+ const DESIRED_COUNT_PARAM = "desiredCount";
4340
+ function buildId$3(id) {
4341
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4342
+ }
4343
+ function buildVersion$3(major, minor, patch) {
4344
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4345
+ }
4346
+ function buildWorkloadType() {
4347
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.CustomWorkloads).withServiceDeliveryModel(ServiceDeliveryModel$1.CaaS).withName(PascalCaseString$1.getBuilder().withValue(WORKLOAD_TYPE_NAME).build()).build();
4348
+ }
4349
+ function pushParam$2(params, key, value) {
4350
+ params.push(key, value);
4351
+ }
4352
+ function buildLinkParams(fromPort, toPort, protocol) {
4353
+ const p = getParametersInstance();
4354
+ p.push("fromPort", fromPort);
4355
+ if (toPort !== void 0) p.push("toPort", toPort);
4356
+ if (protocol) p.push("protocol", protocol);
4357
+ return p;
4358
+ }
4359
+ function makeWorkloadComponent(component) {
4360
+ return {
4361
+ component,
4362
+ components: [component],
4363
+ linkToWorkload: (links) => {
4364
+ const portLinks = links.map((l) => getLinkBuilder().withId(l.target.component.id).withType(buildWorkloadType()).withParameters(buildLinkParams(l.fromPort, l.toPort, l.protocol)).build());
4365
+ return makeWorkloadComponent({
4366
+ ...component,
4367
+ links: [...component.links, ...portLinks]
4368
+ });
4369
+ },
4370
+ linkToSecurityGroup: (sgs) => {
4371
+ const sgLinks = sgs.map((sg) => getLinkBuilder().withId(sg.id).withType(sg.type).withParameters(getParametersInstance()).build());
4372
+ return makeWorkloadComponent({
4373
+ ...component,
4374
+ links: [...component.links, ...sgLinks]
4375
+ });
4376
+ }
4377
+ };
4378
+ }
4379
+ let Workload;
4380
+ (function(_Workload) {
4381
+ const getBuilder = _Workload.getBuilder = () => {
4382
+ const params = getParametersInstance();
4383
+ const inner = getBlueprintComponentBuilder().withType(buildWorkloadType()).withParameters(params);
4384
+ const builder = {
4385
+ withId: (id) => {
4386
+ inner.withId(buildId$3(id));
4387
+ return builder;
4388
+ },
4389
+ withVersion: (major, minor, patch) => {
4390
+ inner.withVersion(buildVersion$3(major, minor, patch));
4391
+ return builder;
4392
+ },
4393
+ withDisplayName: (displayName) => {
4394
+ inner.withDisplayName(displayName);
4395
+ return builder;
4396
+ },
4397
+ withDescription: (description) => {
4398
+ inner.withDescription(description);
4399
+ return builder;
4400
+ },
4401
+ withContainerImage: (image) => {
4402
+ pushParam$2(params, CONTAINER_IMAGE_PARAM, image);
4403
+ return builder;
4404
+ },
4405
+ withContainerPort: (port) => {
4406
+ pushParam$2(params, CONTAINER_PORT_PARAM, port);
4407
+ return builder;
4408
+ },
4409
+ withContainerName: (name) => {
4410
+ pushParam$2(params, CONTAINER_NAME_PARAM, name);
4411
+ return builder;
4412
+ },
4413
+ withCpu: (cpu) => {
4414
+ pushParam$2(params, CPU_PARAM, cpu);
4415
+ return builder;
4416
+ },
4417
+ withMemory: (memory) => {
4418
+ pushParam$2(params, MEMORY_PARAM, memory);
4419
+ return builder;
4420
+ },
4421
+ withDesiredCount: (count) => {
4422
+ pushParam$2(params, DESIRED_COUNT_PARAM, count);
4423
+ return builder;
4424
+ },
4425
+ build: () => inner.build()
4426
+ };
4427
+ return builder;
4428
+ };
4429
+ _Workload.create = (config) => {
4430
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withContainerImage(config.containerImage);
4431
+ if (config.description) b.withDescription(config.description);
4432
+ if (config.containerPort !== void 0) b.withContainerPort(config.containerPort);
4433
+ if (config.containerName) b.withContainerName(config.containerName);
4434
+ if (config.cpu) b.withCpu(config.cpu);
4435
+ if (config.memory) b.withMemory(config.memory);
4436
+ if (config.desiredCount !== void 0) b.withDesiredCount(config.desiredCount);
4437
+ return makeWorkloadComponent(b.build());
4438
+ };
4439
+ })(Workload || (Workload = {}));
4440
+
4441
+ //#endregion
4442
+ //#region src/live_system/component/network_and_compute/paas/ecs_cluster.ts
4443
+ const ECS_CLUSTER_TYPE_NAME = "ECS";
4444
+ function buildId$2(id) {
4445
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4446
+ }
4447
+ function buildVersion$2(major, minor, patch) {
4448
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4449
+ }
4450
+ function buildAwsEcsClusterType() {
4451
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(ECS_CLUSTER_TYPE_NAME).build()).build();
4452
+ }
4453
+ let AwsEcsCluster;
4454
+ (function(_AwsEcsCluster) {
4455
+ const getBuilder = _AwsEcsCluster.getBuilder = () => {
4456
+ const params = getParametersInstance();
4457
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsClusterType()).withParameters(params).withProvider("AWS");
4458
+ const builder = {
4459
+ withId: (id) => {
4460
+ inner.withId(buildId$2(id));
4461
+ return builder;
4462
+ },
4463
+ withVersion: (major, minor, patch) => {
4464
+ inner.withVersion(buildVersion$2(major, minor, patch));
4465
+ return builder;
4466
+ },
4467
+ withDisplayName: (displayName) => {
4468
+ inner.withDisplayName(displayName);
4469
+ return builder;
4470
+ },
4471
+ withDescription: (description) => {
4472
+ inner.withDescription(description);
4473
+ return builder;
4474
+ },
4475
+ build: () => inner.build()
4476
+ };
4477
+ return builder;
4478
+ };
4479
+ _AwsEcsCluster.satisfy = (platform) => {
4480
+ 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);
4481
+ if (platform.description) inner.withDescription(platform.description);
4482
+ return { build: () => inner.build() };
4483
+ };
4484
+ _AwsEcsCluster.create = (config) => {
4485
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
4486
+ if (config.description) b.withDescription(config.description);
4487
+ return b.build();
4488
+ };
4489
+ })(AwsEcsCluster || (AwsEcsCluster = {}));
4490
+
4491
+ //#endregion
4492
+ //#region src/live_system/component/network_and_compute/paas/ecs_task_definition.ts
4493
+ const ECS_TASK_DEF_TYPE_NAME = "ECSTaskDefinition";
4494
+ const NETWORK_MODE_PARAM = "networkMode";
4495
+ const EXECUTION_ROLE_ARN_PARAM = "executionRoleArn";
4496
+ const TASK_ROLE_ARN_PARAM = "taskRoleArn";
4497
+ function buildId$1(id) {
4498
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4499
+ }
4500
+ function buildVersion$1(major, minor, patch) {
4501
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4502
+ }
4503
+ function buildAwsEcsTaskDefType() {
4504
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(ECS_TASK_DEF_TYPE_NAME).build()).build();
4505
+ }
4506
+ function pushParam$1(params, key, value) {
4507
+ params.push(key, value);
4508
+ }
4509
+ let AwsEcsTaskDefinition;
4510
+ (function(_AwsEcsTaskDefinition) {
4511
+ const getBuilder = _AwsEcsTaskDefinition.getBuilder = () => {
4512
+ const params = getParametersInstance();
4513
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsTaskDefType()).withParameters(params).withProvider("AWS");
4514
+ const builder = {
4515
+ withId: (id) => {
4516
+ inner.withId(buildId$1(id));
4517
+ return builder;
4518
+ },
4519
+ withVersion: (major, minor, patch) => {
4520
+ inner.withVersion(buildVersion$1(major, minor, patch));
4521
+ return builder;
4522
+ },
4523
+ withDisplayName: (displayName) => {
4524
+ inner.withDisplayName(displayName);
4525
+ return builder;
4526
+ },
4527
+ withDescription: (description) => {
4528
+ inner.withDescription(description);
4529
+ return builder;
4530
+ },
4531
+ withContainerImage: (image) => {
4532
+ pushParam$1(params, CONTAINER_IMAGE_PARAM, image);
4533
+ return builder;
4534
+ },
4535
+ withContainerPort: (port) => {
4536
+ pushParam$1(params, CONTAINER_PORT_PARAM, port);
4537
+ return builder;
4538
+ },
4539
+ withContainerName: (name) => {
4540
+ pushParam$1(params, CONTAINER_NAME_PARAM, name);
4541
+ return builder;
4542
+ },
4543
+ withCpu: (cpu) => {
4544
+ pushParam$1(params, CPU_PARAM, cpu);
4545
+ return builder;
4546
+ },
4547
+ withMemory: (memory) => {
4548
+ pushParam$1(params, MEMORY_PARAM, memory);
4549
+ return builder;
4550
+ },
4551
+ withNetworkMode: (mode) => {
4552
+ pushParam$1(params, NETWORK_MODE_PARAM, mode);
4553
+ return builder;
4554
+ },
4555
+ withExecutionRoleArn: (arn) => {
4556
+ pushParam$1(params, EXECUTION_ROLE_ARN_PARAM, arn);
4557
+ return builder;
4558
+ },
4559
+ withTaskRoleArn: (arn) => {
4560
+ pushParam$1(params, TASK_ROLE_ARN_PARAM, arn);
4561
+ return builder;
4562
+ },
4563
+ build: () => inner.build()
4564
+ };
4565
+ return builder;
4566
+ };
4567
+ _AwsEcsTaskDefinition.satisfy = (workload) => {
4568
+ const params = getParametersInstance();
4569
+ const taskId = `${workload.id.toString()}-task`;
4570
+ 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);
4571
+ if (workload.description) inner.withDescription(workload.description);
4572
+ for (const key of [
4573
+ CONTAINER_IMAGE_PARAM,
4574
+ CONTAINER_PORT_PARAM,
4575
+ CONTAINER_NAME_PARAM,
4576
+ CPU_PARAM,
4577
+ MEMORY_PARAM
4578
+ ]) {
4579
+ const v = workload.parameters.getOptionalFieldByName(key);
4580
+ if (v !== null) pushParam$1(params, key, v);
4581
+ }
4582
+ const satisfiedBuilder = {
4583
+ withNetworkMode: (mode) => {
4584
+ pushParam$1(params, NETWORK_MODE_PARAM, mode);
4585
+ return satisfiedBuilder;
4586
+ },
4587
+ withExecutionRoleArn: (arn) => {
4588
+ pushParam$1(params, EXECUTION_ROLE_ARN_PARAM, arn);
4589
+ return satisfiedBuilder;
4590
+ },
4591
+ withTaskRoleArn: (arn) => {
4592
+ pushParam$1(params, TASK_ROLE_ARN_PARAM, arn);
4593
+ return satisfiedBuilder;
4594
+ },
4595
+ build: () => inner.build()
4596
+ };
4597
+ return satisfiedBuilder;
4598
+ };
4599
+ _AwsEcsTaskDefinition.create = (config) => {
4600
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withContainerImage(config.containerImage);
4601
+ if (config.description) b.withDescription(config.description);
4602
+ if (config.containerPort !== void 0) b.withContainerPort(config.containerPort);
4603
+ if (config.containerName) b.withContainerName(config.containerName);
4604
+ if (config.cpu) b.withCpu(config.cpu);
4605
+ if (config.memory) b.withMemory(config.memory);
4606
+ if (config.networkMode) b.withNetworkMode(config.networkMode);
4607
+ if (config.executionRoleArn) b.withExecutionRoleArn(config.executionRoleArn);
4608
+ if (config.taskRoleArn) b.withTaskRoleArn(config.taskRoleArn);
4609
+ return b.build();
4610
+ };
4611
+ })(AwsEcsTaskDefinition || (AwsEcsTaskDefinition = {}));
4612
+
4613
+ //#endregion
4614
+ //#region src/live_system/component/network_and_compute/paas/ecs_service.ts
4615
+ const ECS_SERVICE_TYPE_NAME = "ECSService";
4616
+ const LAUNCH_TYPE_PARAM = "launchType";
4617
+ const ASSIGN_PUBLIC_IP_PARAM = "assignPublicIp";
4618
+ function buildId(id) {
4619
+ return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
4620
+ }
4621
+ function buildVersion(major, minor, patch) {
4622
+ return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
4623
+ }
4624
+ function buildAwsEcsServiceType() {
4625
+ return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(ECS_SERVICE_TYPE_NAME).build()).build();
4626
+ }
4627
+ function pushParam(params, key, value) {
4628
+ params.push(key, value);
4629
+ }
4630
+ let AwsEcsService;
4631
+ (function(_AwsEcsService) {
4632
+ const getBuilder = _AwsEcsService.getBuilder = () => {
4633
+ const params = getParametersInstance();
4634
+ const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsServiceType()).withParameters(params).withProvider("AWS");
4635
+ const builder = {
4636
+ withId: (id) => {
4637
+ inner.withId(buildId(id));
4638
+ return builder;
4639
+ },
4640
+ withVersion: (major, minor, patch) => {
4641
+ inner.withVersion(buildVersion(major, minor, patch));
4642
+ return builder;
4643
+ },
4644
+ withDisplayName: (displayName) => {
4645
+ inner.withDisplayName(displayName);
4646
+ return builder;
4647
+ },
4648
+ withDescription: (description) => {
4649
+ inner.withDescription(description);
4650
+ return builder;
4651
+ },
4652
+ withDesiredCount: (count) => {
4653
+ pushParam(params, DESIRED_COUNT_PARAM, count);
4654
+ return builder;
4655
+ },
4656
+ withLaunchType: (type) => {
4657
+ pushParam(params, LAUNCH_TYPE_PARAM, type);
4658
+ return builder;
4659
+ },
4660
+ withAssignPublicIp: (assign) => {
4661
+ pushParam(params, ASSIGN_PUBLIC_IP_PARAM, assign);
4662
+ return builder;
4663
+ },
4664
+ build: () => inner.build()
4665
+ };
4666
+ return builder;
4667
+ };
4668
+ _AwsEcsService.satisfy = (workload) => {
4669
+ const params = getParametersInstance();
4670
+ const deps = [...workload.dependencies];
4671
+ 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(deps).withLinks(workload.links);
4672
+ if (workload.description) inner.withDescription(workload.description);
4673
+ const desiredCount = workload.parameters.getOptionalFieldByName(DESIRED_COUNT_PARAM);
4674
+ if (desiredCount !== null) pushParam(params, DESIRED_COUNT_PARAM, desiredCount);
4675
+ const satisfiedBuilder = {
4676
+ withLaunchType: (type) => {
4677
+ pushParam(params, LAUNCH_TYPE_PARAM, type);
4678
+ return satisfiedBuilder;
4679
+ },
4680
+ withAssignPublicIp: (assign) => {
4681
+ pushParam(params, ASSIGN_PUBLIC_IP_PARAM, assign);
4682
+ return satisfiedBuilder;
4683
+ },
4684
+ withTaskDefinition: (taskDef) => {
4685
+ deps.push({ id: taskDef.id });
4686
+ inner.withDependencies(deps);
4687
+ return satisfiedBuilder;
4688
+ },
4689
+ build: () => inner.build()
4690
+ };
4691
+ return satisfiedBuilder;
4692
+ };
4693
+ _AwsEcsService.create = (config) => {
4694
+ const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
4695
+ if (config.description) b.withDescription(config.description);
4696
+ if (config.desiredCount !== void 0) b.withDesiredCount(config.desiredCount);
4697
+ if (config.launchType) b.withLaunchType(config.launchType);
4698
+ if (config.assignPublicIp !== void 0) b.withAssignPublicIp(config.assignPublicIp);
4699
+ return b.build();
4700
+ };
4701
+ })(AwsEcsService || (AwsEcsService = {}));
4702
+
2012
4703
  //#endregion
2013
4704
  //#region src/index.ts
2014
4705
  const BoundedContext = BoundedContext$1;
@@ -2026,4 +4717,4 @@ const Environment = Environment$1;
2026
4717
  const LiveSystem = LiveSystem$1;
2027
4718
 
2028
4719
  //#endregion
2029
- export { BoundedContext, Environment, Fractal, InfrastructureDomain, KebabCaseString, LiveSystem, OwnerId, OwnerType, PascalCaseString, ServiceAccountCredentials, ServiceAccountId, ServiceDeliveryModel, Version };
4720
+ 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 };