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