@fractal_cloud/sdk 1.5.0 → 1.5.1

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
@@ -5525,18 +5525,109 @@ function buildContainerPlatformType() {
5525
5525
  function pushParam$85(params, key, value) {
5526
5526
  params.push(key, value);
5527
5527
  }
5528
- function makeContainerPlatformComponent(platform, workloadNodes) {
5528
+ function appendDep(bp, dep) {
5529
+ return {
5530
+ ...bp,
5531
+ dependencies: [...bp.dependencies, dep]
5532
+ };
5533
+ }
5534
+ const emptyCollections = {
5535
+ workloads: [],
5536
+ apiGateway: void 0,
5537
+ brokers: [],
5538
+ searches: [],
5539
+ monitoring: void 0,
5540
+ tracing: void 0,
5541
+ logging: void 0,
5542
+ serviceMesh: void 0
5543
+ };
5544
+ function makeContainerPlatformComponent(platform, caas) {
5529
5545
  const platformDep = { id: platform.id };
5546
+ const wiredWorkloads = caas.workloads.map((w) => ({
5547
+ ...w,
5548
+ component: appendDep(w.component, platformDep)
5549
+ }));
5550
+ const wiredBrokers = caas.brokers.map((b) => {
5551
+ const broker = appendDep(b.broker, platformDep);
5552
+ return {
5553
+ ...b,
5554
+ broker
5555
+ };
5556
+ });
5557
+ const wiredSearches = caas.searches.map((s) => {
5558
+ const search = appendDep(s.search, platformDep);
5559
+ return {
5560
+ ...s,
5561
+ search
5562
+ };
5563
+ });
5564
+ const wireSingleton = (node) => {
5565
+ if (!node) return;
5566
+ const component = appendDep(node.component, platformDep);
5567
+ return {
5568
+ ...node,
5569
+ component,
5570
+ components: [component]
5571
+ };
5572
+ };
5573
+ const wiredApiGateway = wireSingleton(caas.apiGateway);
5574
+ const wiredMonitoring = wireSingleton(caas.monitoring);
5575
+ const wiredTracing = wireSingleton(caas.tracing);
5576
+ const wiredLogging = wireSingleton(caas.logging);
5577
+ const wiredServiceMesh = wireSingleton(caas.serviceMesh);
5530
5578
  return {
5531
5579
  platform,
5532
- workloads: workloadNodes.map((w) => ({
5533
- ...w,
5534
- component: {
5535
- ...w.component,
5536
- dependencies: [...w.component.dependencies, platformDep]
5537
- }
5538
- })),
5539
- withWorkloads: (newWorkloads) => makeContainerPlatformComponent(platform, newWorkloads)
5580
+ workloads: wiredWorkloads,
5581
+ apiGateway: wiredApiGateway,
5582
+ brokers: wiredBrokers,
5583
+ searches: wiredSearches,
5584
+ monitoring: wiredMonitoring,
5585
+ tracing: wiredTracing,
5586
+ logging: wiredLogging,
5587
+ serviceMesh: wiredServiceMesh,
5588
+ components: [
5589
+ platform,
5590
+ ...wiredWorkloads.map((w) => w.component),
5591
+ ...wiredApiGateway ? [wiredApiGateway.component] : [],
5592
+ ...wiredBrokers.flatMap((b) => [b.broker, ...b.entities.map((e) => e.component)]),
5593
+ ...wiredSearches.flatMap((s) => [s.search, ...s.entities.map((e) => e.component)]),
5594
+ ...wiredMonitoring ? [wiredMonitoring.component] : [],
5595
+ ...wiredTracing ? [wiredTracing.component] : [],
5596
+ ...wiredLogging ? [wiredLogging.component] : [],
5597
+ ...wiredServiceMesh ? [wiredServiceMesh.component] : []
5598
+ ],
5599
+ withWorkloads: (workloads) => makeContainerPlatformComponent(platform, {
5600
+ ...caas,
5601
+ workloads
5602
+ }),
5603
+ withApiGateway: (apiGateway) => makeContainerPlatformComponent(platform, {
5604
+ ...caas,
5605
+ apiGateway
5606
+ }),
5607
+ withBrokers: (brokers) => makeContainerPlatformComponent(platform, {
5608
+ ...caas,
5609
+ brokers
5610
+ }),
5611
+ withSearches: (searches) => makeContainerPlatformComponent(platform, {
5612
+ ...caas,
5613
+ searches
5614
+ }),
5615
+ withMonitoring: (monitoring) => makeContainerPlatformComponent(platform, {
5616
+ ...caas,
5617
+ monitoring
5618
+ }),
5619
+ withTracing: (tracing) => makeContainerPlatformComponent(platform, {
5620
+ ...caas,
5621
+ tracing
5622
+ }),
5623
+ withLogging: (logging) => makeContainerPlatformComponent(platform, {
5624
+ ...caas,
5625
+ logging
5626
+ }),
5627
+ withServiceMesh: (serviceMesh) => makeContainerPlatformComponent(platform, {
5628
+ ...caas,
5629
+ serviceMesh
5630
+ })
5540
5631
  };
5541
5632
  }
5542
5633
  let ContainerPlatform;
@@ -5573,7 +5664,7 @@ let ContainerPlatform;
5573
5664
  const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
5574
5665
  if (config.description) b.withDescription(config.description);
5575
5666
  if (config.nodePools) b.withNodePools(config.nodePools);
5576
- return makeContainerPlatformComponent(b.build(), []);
5667
+ return makeContainerPlatformComponent(b.build(), emptyCollections);
5577
5668
  };
5578
5669
  })(ContainerPlatform || (ContainerPlatform = {}));
5579
5670
 
@@ -5616,6 +5707,13 @@ function buildPortLinkParams(fromPort, toPort, protocol) {
5616
5707
  if (protocol) p.push("protocol", protocol);
5617
5708
  return p;
5618
5709
  }
5710
+ function buildMessagingLinkParams$1(s) {
5711
+ const p = getParametersInstance();
5712
+ p.push("access", s.access);
5713
+ if (s.consumerGroup !== void 0) p.push("consumerGroup", s.consumerGroup);
5714
+ if (s.startingPosition !== void 0) p.push("startingPosition", s.startingPosition);
5715
+ return p;
5716
+ }
5619
5717
  function buildApiGatewayLinkParams(s) {
5620
5718
  const p = getParametersInstance();
5621
5719
  p.push("prefix", s.prefix);
@@ -5650,6 +5748,13 @@ function makeWorkloadComponent(component) {
5650
5748
  ...component,
5651
5749
  links: [...component.links, ...gwLinks]
5652
5750
  });
5751
+ },
5752
+ linkToMessagingEntity: (links) => {
5753
+ const msgLinks = links.map((l) => getLinkBuilder().withId(l.target.component.id).withType(l.target.component.type).withParameters(buildMessagingLinkParams$1(l)).build());
5754
+ return makeWorkloadComponent({
5755
+ ...component,
5756
+ links: [...component.links, ...msgLinks]
5757
+ });
5653
5758
  }
5654
5759
  };
5655
5760
  }
@@ -12804,6 +12909,11 @@ const PACKAGE_NAME_PARAM = "packageName";
12804
12909
  const ENTRY_POINT_PARAM = "entryPoint";
12805
12910
  const ENTRY_POINT_ARGS_PARAM = "entryPointArgs";
12806
12911
  const ARTIFACT_TYPE_PYTHON_WHEEL = "python_wheel";
12912
+ const DATALAKE_PURPOSE_PARAM = "purpose";
12913
+ const DATALAKE_PATH_PARAM = "path";
12914
+ const MESSAGING_ACCESS_PARAM = "access";
12915
+ const MESSAGING_CONSUMER_GROUP_PARAM = "consumerGroup";
12916
+ const MESSAGING_STARTING_POSITION_PARAM = "startingPosition";
12807
12917
  function buildId$45(id) {
12808
12918
  return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
12809
12919
  }
@@ -12816,10 +12926,37 @@ function buildDataProcessingJobType() {
12816
12926
  function pushParam$27(params, key, value) {
12817
12927
  params.push(key, value);
12818
12928
  }
12929
+ function buildDatalakeLinkParams(s) {
12930
+ const p = getParametersInstance();
12931
+ p.push(DATALAKE_PURPOSE_PARAM, s.purpose);
12932
+ if (s.path !== void 0) p.push(DATALAKE_PATH_PARAM, s.path);
12933
+ return p;
12934
+ }
12935
+ function buildMessagingLinkParams(s) {
12936
+ const p = getParametersInstance();
12937
+ p.push(MESSAGING_ACCESS_PARAM, s.access);
12938
+ if (s.consumerGroup !== void 0) p.push(MESSAGING_CONSUMER_GROUP_PARAM, s.consumerGroup);
12939
+ if (s.startingPosition !== void 0) p.push(MESSAGING_STARTING_POSITION_PARAM, s.startingPosition);
12940
+ return p;
12941
+ }
12819
12942
  function makeDataProcessingJobComponent(component) {
12820
12943
  return {
12821
12944
  component,
12822
- components: [component]
12945
+ components: [component],
12946
+ linkToDatalake: (links) => {
12947
+ const lakeLinks = links.map((l) => getLinkBuilder().withId(l.target.component.id).withType(l.target.component.type).withParameters(buildDatalakeLinkParams(l)).build());
12948
+ return makeDataProcessingJobComponent({
12949
+ ...component,
12950
+ links: [...component.links, ...lakeLinks]
12951
+ });
12952
+ },
12953
+ linkToMessagingEntity: (links) => {
12954
+ const msgLinks = links.map((l) => getLinkBuilder().withId(l.target.component.id).withType(l.target.component.type).withParameters(buildMessagingLinkParams(l)).build());
12955
+ return makeDataProcessingJobComponent({
12956
+ ...component,
12957
+ links: [...component.links, ...msgLinks]
12958
+ });
12959
+ }
12823
12960
  };
12824
12961
  }
12825
12962
  let DataProcessingJob;