@flowuent-org/diagramming-core 1.0.5
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/.editorconfig +13 -0
- package/.eslintignore +1 -0
- package/.eslintrc.json +35 -0
- package/.prettierignore +4 -0
- package/.prettierrc +3 -0
- package/.vscode/settings.json +6 -0
- package/README.md +95 -0
- package/apps/authentication/tsconfig.app.json +23 -0
- package/apps/authentication/tsconfig.json +21 -0
- package/apps/authentication/tsconfig.spec.json +28 -0
- package/apps/authentication/vite.config.ts +0 -0
- package/apps/diagramming/.eslintrc.json +18 -0
- package/apps/diagramming/index.html +16 -0
- package/apps/diagramming/project.json +53 -0
- package/apps/diagramming/public/aws-icons/compute/App Runner.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Application Auto Scaling.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Batch.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Bottlerocket.svg +20 -0
- package/apps/diagramming/public/aws-icons/compute/Compute Optimizer.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/EC2 Auto Scaling.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/EC2 Image Builder.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/EC2.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Elastic Beanstalk.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Elastic Fabric Adapter.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Fargate.svg +20 -0
- package/apps/diagramming/public/aws-icons/compute/Genomics CLI.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Lambda.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Local Zones.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/NICE DCV.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/NICE EnginFrame.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Nitro Enclaves.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Outposts family.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Outposts rack.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Outposts servers.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/ParallelCluster.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Serverless Application Repository.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/SimSpace Weaver.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Thinkbox Deadline.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Thinkbox Frost.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Thinkbox Sequoia.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Thinkbox Stoke.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Thinkbox XMesh.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/VMware Cloud on AWS.svg +18 -0
- package/apps/diagramming/public/aws-icons/compute/Wavelength.svg +18 -0
- package/apps/diagramming/public/aws-icons/container/ECS Anywhere.svg +18 -0
- package/apps/diagramming/public/aws-icons/container/EKS Anywhere.svg +18 -0
- package/apps/diagramming/public/aws-icons/container/EKS Cloud.svg +18 -0
- package/apps/diagramming/public/aws-icons/container/EKS Distro.svg +18 -0
- package/apps/diagramming/public/aws-icons/container/Elastic Container Registry.svg +18 -0
- package/apps/diagramming/public/aws-icons/container/Elastic Container Service.svg +18 -0
- package/apps/diagramming/public/aws-icons/container/Elastic Kubernetes Service.svg +18 -0
- package/apps/diagramming/public/aws-icons/container/Fargate.svg +20 -0
- package/apps/diagramming/public/aws-icons/container/Red Hat OpenShift Service on AWS.svg +18 -0
- package/apps/diagramming/public/aws-icons/database/Aurora.svg +18 -0
- package/apps/diagramming/public/aws-icons/database/Database Migration Service.svg +18 -0
- package/apps/diagramming/public/aws-icons/database/DocumentDB.svg +18 -0
- package/apps/diagramming/public/aws-icons/database/ElastiCache.svg +18 -0
- package/apps/diagramming/public/aws-icons/database/Keyspaces.svg +16 -0
- package/apps/diagramming/public/aws-icons/database/MemoryDB for Redis.svg +18 -0
- package/apps/diagramming/public/aws-icons/database/Neptune.svg +18 -0
- package/apps/diagramming/public/aws-icons/database/RDS on VMware.svg +18 -0
- package/apps/diagramming/public/aws-icons/database/RDS.svg +18 -0
- package/apps/diagramming/public/aws-icons/database/Timestream.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/App Mesh.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Client VPN.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Cloud Directory.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Cloud Map.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Cloud WAN.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/CloudFront.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Direct Connect.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Elastic Load Balancing.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Global Accelerator.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Private 5G.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/PrivateLink.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Route 53.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Site to Site VPN.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Transit Gateway.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/VPC Lattice.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Verified Access.svg +18 -0
- package/apps/diagramming/public/aws-icons/networking/Virtual Private Cloud.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Artifact.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Audit Manager.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Certificate Manager.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/CloudHSM.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Cognito.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Detective.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Directory Service.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Firewall Manager.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/GuardDuty.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/IAM Identity Center.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Identity and Access Management.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Inspector.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Key Management Service.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Macie.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Network Firewall.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Private Certificate Authority.svg +1 -0
- package/apps/diagramming/public/aws-icons/security/Resource Access Manager.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Secrets Manager.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Security Hub.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Security Lake.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Shield.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Signer.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/Verified Permissions.svg +18 -0
- package/apps/diagramming/public/aws-icons/security/WAF.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/Backup.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/EFS.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/Elastic Block Store.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/Elastic Disaster Recovery.svg +16 -0
- package/apps/diagramming/public/aws-icons/storage/FSx for Lustre.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/FSx for NetApp ONTAP.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/FSx for OpenZFS.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/FSx for WFS.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/FSx.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/File Cache.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/S3 on Outposts.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/Simple Storage Service Glacier.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/Simple Storage Service.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/Snowball Edge.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/Snowball.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/Snowcone.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/Snowmobile.svg +18 -0
- package/apps/diagramming/public/aws-icons/storage/Storage Gateway.svg +18 -0
- package/apps/diagramming/public/azure-icons/compute/00195-icon-service-Maintenance-Configuration.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/00328-icon-service-Host-Pools.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/00329-icon-service-Application-Group.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/00330-icon-service-Workspaces.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/00398-icon-service-Disk-Encryption-Sets.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/00400-icon-service-Workspaces.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/02112-icon-service-Automanaged-VM.svg +2 -0
- package/apps/diagramming/public/azure-icons/compute/02370-icon-service-Managed-Service-Fabric.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/02409-icon-service-Metrics-Advisor.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/02634-icon-service-Image-Templates.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/02817-icon-service-Restore-Points.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/02818-icon-service-Restore-Points-Collections.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/02864-icon-service-Azure-Compute-Galleries.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/03487-icon-service-Compute-Fleet.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/03543-icon-service-AKS-Automatic.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10021-icon-service-Virtual-Machine.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10023-icon-service-Kubernetes-Services.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10024-icon-service-Mesh-Applications.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10025-icon-service-Availability-Sets.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10026-icon-service-Disks-Snapshots.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10027-icon-service-OS-Images-(Classic).svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10028-icon-service-Virtual-Machines-(Classic).svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10029-icon-service-Function-Apps.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10030-icon-service-Cloud-Services-(Classic).svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10031-icon-service-Batch-Accounts.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10032-icon-service-Disks.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10033-icon-service-Images.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10034-icon-service-VM-Scale-Sets.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10035-icon-service-App-Services.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10036-icon-service-Service-Fabric-Clusters.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10037-icon-service-Image-Definitions.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10038-icon-service-Image-Versions.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10039-icon-service-Shared-Image-Galleries.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10040-icon-service-VM-Images-(Classic).svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10041-icon-service-Disks-(Classic).svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10049-icon-service-Container-Services-(Deprecated).svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10104-icon-service-Container-Instances.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10346-icon-service-Host-Groups.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10347-icon-service-Hosts.svg +1 -0
- package/apps/diagramming/public/azure-icons/compute/10370-icon-service-Azure-Spring-Apps.svg +1 -0
- package/apps/diagramming/public/azure-icons/containers/03331-icon-service-Azure-Red-Hat-OpenShift.svg +1 -0
- package/apps/diagramming/public/azure-icons/containers/10023-icon-service-Kubernetes-Services.svg +1 -0
- package/apps/diagramming/public/azure-icons/containers/10031-icon-service-Batch-Accounts.svg +1 -0
- package/apps/diagramming/public/azure-icons/containers/10035-icon-service-App-Services.svg +1 -0
- package/apps/diagramming/public/azure-icons/containers/10036-icon-service-Service-Fabric-Clusters.svg +1 -0
- package/apps/diagramming/public/azure-icons/containers/10104-icon-service-Container-Instances.svg +1 -0
- package/apps/diagramming/public/azure-icons/containers/10105-icon-service-Container-Registries.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/00036-icon-service-SQL-Data-Warehouses.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/00606-icon-service-Azure-Synapse-Analytics.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/02390-icon-service-Azure-SQL.svg +2 -0
- package/apps/diagramming/public/azure-icons/databases/02392-icon-service-SSIS-Lift-And-Shift-IR.svg +2 -0
- package/apps/diagramming/public/azure-icons/databases/02517-icon-service-Azure-Purview-Accounts.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/02750-icon-service-Azure-SQL-Edge.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/02827-icon-service-Azure-Database-PostgreSQL-Server-Group.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/03490-icon-service-Oracle-Database.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10121-icon-service-Azure-Cosmos-DB.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10122-icon-service-Azure-Database-MySQL-Server.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10123-icon-service-Azure-Database-MariaDB-Server.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10124-icon-service-Azure-SQL-VM.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10126-icon-service-Data-Factories.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10127-icon-service-Virtual-Clusters.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10128-icon-service-Elastic-Job-Agents.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10130-icon-service-SQL-Database.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10131-icon-service-Azure-Database-PostgreSQL-Server.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10132-icon-service-SQL-Server.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10133-icon-service-Azure-Database-Migration-Services.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10134-icon-service-SQL-Elastic-Pools.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10135-icon-service-Managed-Database.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10136-icon-service-SQL-Managed-Instance.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10137-icon-service-Azure-SQL-Server-Stretch-Databases.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10137-icon-service-Cache-Redis.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10139-icon-service-Instance-Pools.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10145-icon-service-Azure-Data-Explorer-Clusters.svg +1 -0
- package/apps/diagramming/public/azure-icons/databases/10351-icon-service-SQL-Server-Registries.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/00056-icon-service-CDN-Profiles.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/00271-icon-service-Azure-Firewall-Manager.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/00272-icon-service-Azure-Firewall-Policy.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/00427-icon-service-Private-Link.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/00701-icon-service-IP-Groups.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/00860-icon-service-Virtual-WAN-Hub.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/01105-icon-service-Private-Link-Service.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/02145-icon-service-Resource-Management-Private-Link.svg +2 -0
- package/apps/diagramming/public/azure-icons/networking/02209-icon-service-Private-Link-Services.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/02302-icon-service-Load-Balancer-Hub.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/02422-icon-service-Bastions.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/02496-icon-service-Virtual-Router.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/02509-icon-service-Connected-Cache.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/02692-icon-service-Spot-VMSS.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/02695-icon-service-Spot-VM.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/02742-icon-service-Subnet.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/02882-icon-service-DNS-Private-Resolver.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/03311-icon-service-Azure-Communications-Gateway.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/03328-icon-service-Application-Gateway-Containers.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/03368-icon-service-DNS-Security-Policy.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/03459-icon-service-DNS-Multistack.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/03460-icon-service-ATM-Multistack.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/03461-icon-service-IP-Address-manager.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10061-icon-service-Virtual-Networks.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10062-icon-service-Load-Balancers.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10063-icon-service-Virtual-Network-Gateways.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10064-icon-service-DNS-Zones.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10065-icon-service-Traffic-Manager-Profiles.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10066-icon-service-Network-Watcher.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10067-icon-service-Network-Security-Groups.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10068-icon-service-Public-IP-Addresses-(Classic).svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10069-icon-service-Public-IP-Addresses.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10070-icon-service-On-Premises-Data-Gateways.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10071-icon-service-Route-Filters.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10072-icon-service-DDoS-Protection-Plans.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10073-icon-service-Front-Door-and-CDN-Profiles.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10075-icon-service-Virtual-Networks-(Classic).svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10076-icon-service-Application-Gateways.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10077-icon-service-Local-Network-Gateways.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10079-icon-service-ExpressRoute-Circuits.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10080-icon-service-Network-Interfaces.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10081-icon-service-Connections.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10082-icon-service-Route-Tables.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10084-icon-service-Firewalls.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10085-icon-service-Service-Endpoint-Policies.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10310-icon-service-NAT.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10353-icon-service-Virtual-WANs.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10362-icon-service-Web-Application-Firewall-Policies(WAF).svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10365-icon-service-Proximity-Placement-Groups.svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10371-icon-service-Reserved-IP-Addresses-(Classic).svg +1 -0
- package/apps/diagramming/public/azure-icons/networking/10372-icon-service-Public-IP-Prefixes.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/00378-icon-service-Detonation.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/02247-icon-service-Microsoft-Defender-for-IoT.svg +2 -0
- package/apps/diagramming/public/azure-icons/security/03336-icon-service-Microsoft-Defender-EASM.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/03340-icon-service-Identity-Secure-Score.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/03341-icon-service-Entra-Identity-Risky-Signins.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/03342-icon-service-Entra-Identity-Risky-Users.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/03344-icon-service-Multifactor-Authentication.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/10229-icon-service-Azure-Information-Protection.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/10233-icon-service-Conditional-Access.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/10241-icon-service-Microsoft-Defender-for-Cloud.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/10244-icon-service-Application-Security-Groups.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/10245-icon-service-Key-Vaults.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/10248-icon-service-Azure-Sentinel.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/10433-icon-service-User-Settings.svg +1 -0
- package/apps/diagramming/public/azure-icons/security/10572-icon-service-ExtendedSecurityUpdates.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/00017-icon-service-Recovery-Services-Vaults.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/00691-icon-service-Azure-Databox-Gateway.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/00776-icon-service-Azure-HCP-Cache.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/03502-icon-service-Storage-Actions.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/03549-icon-service-Managed-File-Shares.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10086-icon-service-Storage-Accounts.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10087-icon-service-Storage-Accounts-(Classic).svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10089-icon-service-StorSimple-Device-Managers.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10090-icon-service-Data-Lake-Storage-Gen1.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10091-icon-service-Storage-Explorer.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10092-icon-service-StorSimple-Data-Managers.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10093-icon-service-Storage-Sync-Services.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10094-icon-service-Data-Box.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10095-icon-service-Azure-Stack-Edge.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10096-icon-service-Azure-NetApp-Files.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10097-icon-service-Data-Share-Invitations.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10098-icon-service-Data-Shares.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10100-icon-service-Import-Export-Jobs.svg +1 -0
- package/apps/diagramming/public/azure-icons/storage/10400-icon-service-Azure-Fileshares.svg +1 -0
- package/apps/diagramming/public/block.png +0 -0
- package/apps/diagramming/public/common/users.svg +7 -0
- package/apps/diagramming/public/favicon.ico +0 -0
- package/apps/diagramming/public/gcp-icons/compute/appengine.svg +1 -0
- package/apps/diagramming/public/gcp-icons/compute/cloud-functions.svg +1 -0
- package/apps/diagramming/public/gcp-icons/compute/cloud-gpu.svg +1 -0
- package/apps/diagramming/public/gcp-icons/compute/compute-engine.svg +1 -0
- package/apps/diagramming/public/gcp-icons/compute/container-optimized-os.svg +1 -0
- package/apps/diagramming/public/gcp-icons/database&storage/cloud-bigtable.svg +1 -0
- package/apps/diagramming/public/gcp-icons/database&storage/cloud-spanner.svg +1 -0
- package/apps/diagramming/public/gcp-icons/database&storage/cloud-sql.svg +1 -0
- package/apps/diagramming/public/gcp-icons/database&storage/cloud-storage.svg +1 -0
- package/apps/diagramming/public/gcp-icons/database&storage/filestore.svg +1 -0
- package/apps/diagramming/public/gcp-icons/networking/cloud-cdn.svg +1 -0
- package/apps/diagramming/public/gcp-icons/networking/cloud-dns.svg +1 -0
- package/apps/diagramming/public/gcp-icons/networking/cloud-firewall-rules.svg +1 -0
- package/apps/diagramming/public/gcp-icons/networking/cloud-interconnect.svg +1 -0
- package/apps/diagramming/public/gcp-icons/networking/cloud-load-balancing.svg +1 -0
- package/apps/diagramming/public/gcp-icons/networking/cloud-network.svg +1 -0
- package/apps/diagramming/public/gcp-icons/networking/cloud-router.svg +1 -0
- package/apps/diagramming/public/gcp-icons/networking/cloud-routes.svg +1 -0
- package/apps/diagramming/public/gcp-icons/networking/cloud-vpn.svg +1 -0
- package/apps/diagramming/public/gcp-icons/networking/virtual-private-cloud.svg +1 -0
- package/apps/diagramming/public/gcp-icons/security/beyondcorp.svg +1 -0
- package/apps/diagramming/public/gcp-icons/security/data-loss-prevention-api.svg +1 -0
- package/apps/diagramming/public/gcp-icons/security/iam.svg +1 -0
- package/apps/diagramming/public/gcp-icons/security/key-access-justifications.svg +1 -0
- package/apps/diagramming/public/gcp-icons/security/security-command-center.svg +1 -0
- package/apps/diagramming/public/gcp-icons/security/web-security-scanner.svg +1 -0
- package/apps/diagramming/public/sample-node-complete.json +63 -0
- package/apps/diagramming/public/sample-node-data.json +63 -0
- package/apps/diagramming/public/text.png +0 -0
- package/apps/diagramming/src/AutomationDiagramData.ts +541 -0
- package/apps/diagramming/src/CollaborationDiagramData.ts +127 -0
- package/apps/diagramming/src/CustomIconExamples.ts +233 -0
- package/apps/diagramming/src/DiagramTabs.tsx +205 -0
- package/apps/diagramming/src/Pages/DevPlayground.tsx +3 -0
- package/apps/diagramming/src/Pages/Home.tsx +112 -0
- package/apps/diagramming/src/SequenceDiagramData.ts +215 -0
- package/apps/diagramming/src/StateMachineDiagramData.ts +64 -0
- package/apps/diagramming/src/UseCaseDiagramData.ts +52 -0
- package/apps/diagramming/src/cloud-data.ts +371 -0
- package/apps/diagramming/src/components/AddNodeView.tsx +252 -0
- package/apps/diagramming/src/createSelecors.tsx +17 -0
- package/apps/diagramming/src/index.scss +13 -0
- package/apps/diagramming/src/main.tsx +463 -0
- package/apps/diagramming/src/node-data.ts +664 -0
- package/apps/diagramming/src/sample-workflow-content.ts +54 -0
- package/apps/diagramming/src/stencil-items.ts +31 -0
- package/apps/diagramming/src/style.css +13 -0
- package/apps/diagramming/src/tabsStore.tsx +152 -0
- package/apps/diagramming/src/vite-env.d.ts +1 -0
- package/apps/diagramming/tsconfig.app.json +23 -0
- package/apps/diagramming/tsconfig.json +21 -0
- package/apps/diagramming/tsconfig.spec.json +28 -0
- package/apps/diagramming/vite.config.ts +34 -0
- package/apps/diagramming/webpack.config.js +13 -0
- package/apps/workflow/.eslintrc.json +18 -0
- package/apps/workflow/group/group-form-hooks/index.ts +3 -0
- package/apps/workflow/group/group-form-hooks/useFormValidation.ts +20 -0
- package/apps/workflow/group/group-form-schema/SettingsTabFormSchema.ts +7 -0
- package/apps/workflow/group/group-form-schema/index.ts +3 -0
- package/apps/workflow/i18n.ts +19 -0
- package/apps/workflow/index.html +16 -0
- package/apps/workflow/locales/en/translation.json +713 -0
- package/apps/workflow/project.json +8 -0
- package/apps/workflow/public/favicon.ico +0 -0
- package/apps/workflow/src/app/app.module.css +1 -0
- package/apps/workflow/src/app/app.spec.tsx +15 -0
- package/apps/workflow/src/app/app.tsx +370 -0
- package/apps/workflow/src/assets/.gitkeep +0 -0
- package/apps/workflow/src/main.tsx +13 -0
- package/apps/workflow/src/styles.css +1 -0
- package/apps/workflow/src/theme/index.ts +546 -0
- package/apps/workflow/tsconfig.app.json +23 -0
- package/apps/workflow/tsconfig.json +21 -0
- package/apps/workflow/tsconfig.spec.json +28 -0
- package/apps/workflow/vite.config.ts +51 -0
- package/nx.json +58 -0
- package/package.json +116 -0
- package/packages/api/.babelrc +12 -0
- package/packages/api/.eslintrc.json +18 -0
- package/packages/api/README.md +7 -0
- package/packages/api/project.json +8 -0
- package/packages/api/src/index.ts +3 -0
- package/packages/api/src/lib/jsonPlaceholderService/endpoints.ts +3 -0
- package/packages/api/src/lib/jsonPlaceholderService/service.ts +13 -0
- package/packages/api/tsconfig.json +17 -0
- package/packages/api/tsconfig.lib.json +24 -0
- package/packages/atoms/.babelrc +12 -0
- package/packages/atoms/.eslintrc.json +18 -0
- package/packages/atoms/README.md +7 -0
- package/packages/atoms/forms/AuthenticationTabForm/authenticationTabForm.json +224 -0
- package/packages/atoms/forms/AuthenticationTabForm/index.tsx +255 -0
- package/packages/atoms/forms/SettingsTabForm/index.tsx +85 -0
- package/packages/atoms/forms/SettingsTabForm/settingTabForm.json +27 -0
- package/packages/atoms/forms/index.ts +4 -0
- package/packages/atoms/project.json +8 -0
- package/packages/atoms/src/index.ts +33 -0
- package/packages/atoms/src/lib/Accordion/Accordion.module.css +7 -0
- package/packages/atoms/src/lib/Accordion/Accordion.spec.tsx +13 -0
- package/packages/atoms/src/lib/Accordion/Accordion.tsx +29 -0
- package/packages/atoms/src/lib/Alert/Alert.module.css +7 -0
- package/packages/atoms/src/lib/Alert/Alert.spec.tsx +10 -0
- package/packages/atoms/src/lib/Alert/Alert.tsx +19 -0
- package/packages/atoms/src/lib/Avatar/Avatar.module.css +7 -0
- package/packages/atoms/src/lib/Avatar/Avatar.spec.tsx +10 -0
- package/packages/atoms/src/lib/Avatar/Avatar.tsx +22 -0
- package/packages/atoms/src/lib/Box/Box.module.css +7 -0
- package/packages/atoms/src/lib/Box/Box.spec.tsx +10 -0
- package/packages/atoms/src/lib/Box/Box.tsx +19 -0
- package/packages/atoms/src/lib/BulkEdit/BulkEdit.module.css +7 -0
- package/packages/atoms/src/lib/BulkEdit/BulkEdit.spec.tsx +10 -0
- package/packages/atoms/src/lib/BulkEdit/BulkEdit.tsx +15 -0
- package/packages/atoms/src/lib/Button/Button.module.css +7 -0
- package/packages/atoms/src/lib/Button/Button.spec.tsx +10 -0
- package/packages/atoms/src/lib/Button/Button.tsx +78 -0
- package/packages/atoms/src/lib/Card/Card.module.css +7 -0
- package/packages/atoms/src/lib/Card/Card.spec.tsx +10 -0
- package/packages/atoms/src/lib/Card/Card.tsx +19 -0
- package/packages/atoms/src/lib/CardContent/CardContent.module.css +7 -0
- package/packages/atoms/src/lib/CardContent/CardContent.spec.tsx +10 -0
- package/packages/atoms/src/lib/CardContent/CardContent.tsx +22 -0
- package/packages/atoms/src/lib/FormTextField/FormTextField.module.css +7 -0
- package/packages/atoms/src/lib/FormTextField/FormTextField.spec.tsx +10 -0
- package/packages/atoms/src/lib/FormTextField/FormTextField.tsx +35 -0
- package/packages/atoms/src/lib/Grid/Grid.module.css +7 -0
- package/packages/atoms/src/lib/Grid/Grid.spec.tsx +10 -0
- package/packages/atoms/src/lib/Grid/Grid.tsx +19 -0
- package/packages/atoms/src/lib/Stack/Stack.module.css +7 -0
- package/packages/atoms/src/lib/Stack/Stack.spec.tsx +10 -0
- package/packages/atoms/src/lib/Stack/Stack.tsx +19 -0
- package/packages/atoms/src/lib/Switch/Switch.module.css +7 -0
- package/packages/atoms/src/lib/Switch/Switch.spec.tsx +10 -0
- package/packages/atoms/src/lib/Switch/Switch.tsx +46 -0
- package/packages/atoms/src/lib/TableView/TableView.module.css +7 -0
- package/packages/atoms/src/lib/TableView/TableView.spec.tsx +10 -0
- package/packages/atoms/src/lib/TableView/TableView.tsx +88 -0
- package/packages/atoms/src/lib/TextField/TextField.module.css +7 -0
- package/packages/atoms/src/lib/TextField/TextField.spec.tsx +10 -0
- package/packages/atoms/src/lib/TextField/TextField.tsx +17 -0
- package/packages/atoms/src/lib/Typography/Typography.module.css +7 -0
- package/packages/atoms/src/lib/Typography/Typography.spec.tsx +10 -0
- package/packages/atoms/src/lib/Typography/Typography.tsx +22 -0
- package/packages/atoms/tsconfig.json +17 -0
- package/packages/atoms/tsconfig.lib.json +30 -0
- package/packages/common/.babelrc +12 -0
- package/packages/common/.eslintrc.json +18 -0
- package/packages/common/README.md +7 -0
- package/packages/common/project.json +8 -0
- package/packages/common/src/index.ts +4 -0
- package/packages/common/src/lib/generateRandomProfilePic.ts +3 -0
- package/packages/common/src/lib/generateValidationSchema.ts +46 -0
- package/packages/common/tsconfig.json +17 -0
- package/packages/common/tsconfig.lib.json +24 -0
- package/packages/contexts/.babelrc +12 -0
- package/packages/contexts/.eslintrc.json +18 -0
- package/packages/contexts/README.md +7 -0
- package/packages/contexts/project.json +8 -0
- package/packages/contexts/src/index.ts +2 -0
- package/packages/contexts/tsconfig.json +17 -0
- package/packages/contexts/tsconfig.lib.json +24 -0
- package/packages/diagrams/.babelrc +12 -0
- package/packages/diagrams/.ctirc +208 -0
- package/packages/diagrams/.eslintrc.json +17 -0
- package/packages/diagrams/CUSTOM_ICONS.md +232 -0
- package/packages/diagrams/GOOGLE_SHEETS_IMPLEMENTATION.md +233 -0
- package/packages/diagrams/NODE_DATA_UPDATE_API.md +430 -0
- package/packages/diagrams/README.md +7 -0
- package/packages/diagrams/UNDO_REDO_API.md +306 -0
- package/packages/diagrams/package.json +45 -0
- package/packages/diagrams/project.json +38 -0
- package/packages/diagrams/rollup.config.js +31 -0
- package/packages/diagrams/src/DiagramFlow.tsx +7 -0
- package/packages/diagrams/src/declarations.d.ts +7 -0
- package/packages/diagrams/src/index.ts +113 -0
- package/packages/diagrams/src/index.ts.bak +99 -0
- package/packages/diagrams/src/lib/assets/markers/markers.param.tsx +101 -0
- package/packages/diagrams/src/lib/assets/markers/markers.type.ts +10 -0
- package/packages/diagrams/src/lib/atoms/ActorNode.tsx +124 -0
- package/packages/diagrams/src/lib/atoms/AddNodeAnchor.tsx +97 -0
- package/packages/diagrams/src/lib/atoms/AddParallelColButton.tsx +26 -0
- package/packages/diagrams/src/lib/atoms/BendpointNode.tsx +71 -0
- package/packages/diagrams/src/lib/atoms/CardBlockTypeSelector.tsx +35 -0
- package/packages/diagrams/src/lib/atoms/CardEditableTitle.tsx +76 -0
- package/packages/diagrams/src/lib/atoms/CardMainContent.tsx +19 -0
- package/packages/diagrams/src/lib/atoms/ContentAssist.tsx +341 -0
- package/packages/diagrams/src/lib/atoms/DiagramControls.tsx +57 -0
- package/packages/diagrams/src/lib/atoms/ExpressionInput.tsx +437 -0
- package/packages/diagrams/src/lib/atoms/FloatingConnectionLine.tsx +73 -0
- package/packages/diagrams/src/lib/atoms/LazyIcon.tsx +31 -0
- package/packages/diagrams/src/lib/atoms/MarkerSelector.tsx +106 -0
- package/packages/diagrams/src/lib/atoms/MultiSelectInput.tsx +87 -0
- package/packages/diagrams/src/lib/atoms/ParameterInput.tsx +199 -0
- package/packages/diagrams/src/lib/atoms/PropertyInput.tsx +114 -0
- package/packages/diagrams/src/lib/atoms/StyledBox.tsx +69 -0
- package/packages/diagrams/src/lib/atoms/ValidationError.tsx +37 -0
- package/packages/diagrams/src/lib/atoms/ValidationMessage.tsx +63 -0
- package/packages/diagrams/src/lib/components/AiButton.tsx +52 -0
- package/packages/diagrams/src/lib/components/ControlEdgeList.tsx +304 -0
- package/packages/diagrams/src/lib/components/CreateFunctionModal.tsx +265 -0
- package/packages/diagrams/src/lib/components/CustomCodeModal.tsx +288 -0
- package/packages/diagrams/src/lib/components/DiagramPanel.tsx +331 -0
- package/packages/diagrams/src/lib/components/FunctionModalTooltip.tsx +31 -0
- package/packages/diagrams/src/lib/components/GraphQLCustomCodeModal.tsx +210 -0
- package/packages/diagrams/src/lib/components/Header.tsx +143 -0
- package/packages/diagrams/src/lib/components/MiniMapCommon.tsx +24 -0
- package/packages/diagrams/src/lib/components/ResizeIcon.tsx +82 -0
- package/packages/diagrams/src/lib/components/SideBar.tsx +40 -0
- package/packages/diagrams/src/lib/components/automation/AutomationAISuggestionNode.tsx +241 -0
- package/packages/diagrams/src/lib/components/automation/AutomationApiNode.tsx +519 -0
- package/packages/diagrams/src/lib/components/automation/AutomationEndNode.tsx +318 -0
- package/packages/diagrams/src/lib/components/automation/AutomationExecutionPanel.tsx +439 -0
- package/packages/diagrams/src/lib/components/automation/AutomationFormattingNode.tsx +557 -0
- package/packages/diagrams/src/lib/components/automation/AutomationNoteNode.tsx +168 -0
- package/packages/diagrams/src/lib/components/automation/AutomationSheetsNode.tsx +831 -0
- package/packages/diagrams/src/lib/components/automation/AutomationStartNode.tsx +319 -0
- package/packages/diagrams/src/lib/components/automation/index.ts +8 -0
- package/packages/diagrams/src/lib/contexts/CardDataProvider.tsx +111 -0
- package/packages/diagrams/src/lib/contexts/DiagramProvider.tsx +375 -0
- package/packages/diagrams/src/lib/contexts/diagramStoreTypes.tsx +132 -0
- package/packages/diagrams/src/lib/contexts/onConnect.ts +39 -0
- package/packages/diagrams/src/lib/contexts/onDragStart.ts +28 -0
- package/packages/diagrams/src/lib/contexts/onNodeDragEnd.ts +85 -0
- package/packages/diagrams/src/lib/contexts/onNodesChange.ts +385 -0
- package/packages/diagrams/src/lib/contexts/onWorkflowNodeDelete.ts +65 -0
- package/packages/diagrams/src/lib/contexts/setContentHeight.ts +14 -0
- package/packages/diagrams/src/lib/contexts/setDiagramType.ts +10 -0
- package/packages/diagrams/src/lib/contexts/setEdgeShapeType.ts +7 -0
- package/packages/diagrams/src/lib/contexts/setEdges.ts +9 -0
- package/packages/diagrams/src/lib/contexts/setLayoutDirection.ts +9 -0
- package/packages/diagrams/src/lib/contexts/setNodeSetting.ts +17 -0
- package/packages/diagrams/src/lib/contexts/setNodes.ts +10 -0
- package/packages/diagrams/src/lib/contexts/setPannable.ts +7 -0
- package/packages/diagrams/src/lib/contexts/setSelectedEdge.ts +7 -0
- package/packages/diagrams/src/lib/contexts/setSelectedNode.ts +7 -0
- package/packages/diagrams/src/lib/contexts/undo.ts +163 -0
- package/packages/diagrams/src/lib/contexts/updateNodeSetting.ts +17 -0
- package/packages/diagrams/src/lib/examples/GoogleSheetsConfigurationExamples.ts +306 -0
- package/packages/diagrams/src/lib/examples/TwilioWhatsAppConfigExample.ts +128 -0
- package/packages/diagrams/src/lib/externals.ts +4 -0
- package/packages/diagrams/src/lib/hooks/customUseReactFlow.tsx +90 -0
- package/packages/diagrams/src/lib/hooks/updateNodes.ts +45 -0
- package/packages/diagrams/src/lib/hooks/useAddChildButton.tsx +61 -0
- package/packages/diagrams/src/lib/hooks/useAddSwitchCase.ts +75 -0
- package/packages/diagrams/src/lib/hooks/useAutoRegisterFunctions.ts +135 -0
- package/packages/diagrams/src/lib/hooks/useAutoRegisterVariables.ts +286 -0
- package/packages/diagrams/src/lib/hooks/useDeleteNodeByEvent.ts +64 -0
- package/packages/diagrams/src/lib/hooks/useDragCallbacks.tsx +122 -0
- package/packages/diagrams/src/lib/hooks/useFormValidation.ts +349 -0
- package/packages/diagrams/src/lib/hooks/useFunctionFormCallbacks.ts +136 -0
- package/packages/diagrams/src/lib/hooks/useIsSelectedNode.ts +11 -0
- package/packages/diagrams/src/lib/hooks/useModalControls.ts +13 -0
- package/packages/diagrams/src/lib/hooks/useNodeDragHandlers.ts +43 -0
- package/packages/diagrams/src/lib/hooks/useNodeSelection.ts +55 -0
- package/packages/diagrams/src/lib/hooks/useRenderDividers.tsx +20 -0
- package/packages/diagrams/src/lib/hooks/useRenderPins.tsx +75 -0
- package/packages/diagrams/src/lib/hooks/useResizeObserver.ts +21 -0
- package/packages/diagrams/src/lib/hooks/useTreeChildNode.ts +536 -0
- package/packages/diagrams/src/lib/hooks/useWorkflowNodeActiont.ts +384 -0
- package/packages/diagrams/src/lib/molecules/AddingBlock.tsx +147 -0
- package/packages/diagrams/src/lib/molecules/AvailableVariablesDisplay.tsx +57 -0
- package/packages/diagrams/src/lib/molecules/Block.tsx +143 -0
- package/packages/diagrams/src/lib/molecules/BlockProvider.tsx +28 -0
- package/packages/diagrams/src/lib/molecules/BlockWrapper.tsx +14 -0
- package/packages/diagrams/src/lib/molecules/ConditionRule.tsx +132 -0
- package/packages/diagrams/src/lib/molecules/DraggablePane.tsx +198 -0
- package/packages/diagrams/src/lib/molecules/EntityNodeBlocks.tsx +66 -0
- package/packages/diagrams/src/lib/molecules/SideHandles.tsx +50 -0
- package/packages/diagrams/src/lib/molecules/StencilItem.tsx +85 -0
- package/packages/diagrams/src/lib/molecules/WorkflowNodeActionButtons.tsx +62 -0
- package/packages/diagrams/src/lib/molecules/animated-add-button.tsx +83 -0
- package/packages/diagrams/src/lib/molecules/json-viewer.tsx +107 -0
- package/packages/diagrams/src/lib/organisms/AddNodeView.tsx +102 -0
- package/packages/diagrams/src/lib/organisms/Card/EntityNode.tsx +259 -0
- package/packages/diagrams/src/lib/organisms/Card/card.params.ts +29 -0
- package/packages/diagrams/src/lib/organisms/Card/card.types.ts +5 -0
- package/packages/diagrams/src/lib/organisms/CodeModal.tsx +105 -0
- package/packages/diagrams/src/lib/organisms/ConditionRuleGroup.tsx +139 -0
- package/packages/diagrams/src/lib/organisms/CustomEdge/EdgeMarkers.tsx +51 -0
- package/packages/diagrams/src/lib/organisms/CustomEdge/custom-edge-generator.tsx +130 -0
- package/packages/diagrams/src/lib/organisms/CustomEdge/custom-edge.params.ts +6 -0
- package/packages/diagrams/src/lib/organisms/CustomEdge/custom-edge.type.ts +15 -0
- package/packages/diagrams/src/lib/organisms/CustomEdge/useCreateBendPoint.tsx +119 -0
- package/packages/diagrams/src/lib/organisms/CustomEdge/useEdgeModal.ts +37 -0
- package/packages/diagrams/src/lib/organisms/CustomEdge/useEdgePath.tsx +99 -0
- package/packages/diagrams/src/lib/organisms/DownloadPanel.tsx +345 -0
- package/packages/diagrams/src/lib/organisms/EdgeModal.tsx +243 -0
- package/packages/diagrams/src/lib/organisms/HistoryPane.tsx +118 -0
- package/packages/diagrams/src/lib/organisms/NodeContextMenu.tsx +259 -0
- package/packages/diagrams/src/lib/organisms/PropertiesPane.tsx +276 -0
- package/packages/diagrams/src/lib/organisms/SmartDynamicForm.tsx +226 -0
- package/packages/diagrams/src/lib/organisms/Stencil.tsx +60 -0
- package/packages/diagrams/src/lib/organisms/UseDiagramStore.tsx +4 -0
- package/packages/diagrams/src/lib/organisms/WorkFlowNode/NodeActionButtons.tsx +45 -0
- package/packages/diagrams/src/lib/organisms/WorkFlowNode/NodeTypeDisplay.tsx +26 -0
- package/packages/diagrams/src/lib/organisms/WorkflowNode.tsx +484 -0
- package/packages/diagrams/src/lib/services/GoogleSheetsService.ts +961 -0
- package/packages/diagrams/src/lib/services/SlackService.ts +134 -0
- package/packages/diagrams/src/lib/services/TwilioWhatsAppService.ts +273 -0
- package/packages/diagrams/src/lib/styles.css +3 -0
- package/packages/diagrams/src/lib/templates/DiagramContainer.tsx +17 -0
- package/packages/diagrams/src/lib/templates/DiagramContent.tsx +310 -0
- package/packages/diagrams/src/lib/templates/Diagramming.tsx +178 -0
- package/packages/diagrams/src/lib/templates/PageLinks.tsx +13 -0
- package/packages/diagrams/src/lib/templates/arch/ArchDiagram.tsx +793 -0
- package/packages/diagrams/src/lib/templates/arch/components/EdgeDialog.tsx +83 -0
- package/packages/diagrams/src/lib/templates/arch/components/EdgeSettings.tsx +82 -0
- package/packages/diagrams/src/lib/templates/arch/components/GroupControls.tsx +60 -0
- package/packages/diagrams/src/lib/templates/arch/components/GroupSizeDialog.tsx +82 -0
- package/packages/diagrams/src/lib/templates/arch/components/NodeDialog.tsx +215 -0
- package/packages/diagrams/src/lib/templates/arch/components/nodeTypes.ts +92 -0
- package/packages/diagrams/src/lib/templates/arch/controls/ArchDiagramControls.tsx +350 -0
- package/packages/diagrams/src/lib/templates/arch/data/templatee-data.ts +213 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/components/CloudArchitectureDiagram.tsx +3912 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/components/FormatConverter.tsx +810 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/components/FragmentImporter.tsx +277 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/components/PropertiesPanel.tsx +1063 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/components/ServiceIconPicker.tsx +138 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/components/SettingsSidebar.tsx +657 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/components/SubnetSelector.tsx +469 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/components/nodes/ServiceNode.tsx +310 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/components/nodes/SubnetNode.tsx +475 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/components/nodes/UsersNode.tsx +278 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/data/diagramManager.ts +365 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/data/types.ts +184 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/integration/diagramValidator.ts +379 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/messages/errorMessages.json +96 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/types/localization.ts +369 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/types/validation.ts +73 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/aws-icons.ts +558 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/awsValidation.ts +447 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/azure-icons.ts +803 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/azureValidation.ts +496 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/cloudValidation.ts +930 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/errorMessages.ts +284 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/gcp-icons.ts +187 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/gcpValidation.ts +312 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/genericValidation.ts +690 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/iconMapping.ts +384 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/idGenerator.ts +221 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/localizationManager.ts +301 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/restrictionEngine.ts +551 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/restrictionValidator.ts +401 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/serviceIcons.tsx +129 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/serviceMapping.ts +331 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/translations.ts +55 -0
- package/packages/diagrams/src/lib/templates/cloud-arch/utils/validationExtractor.ts +342 -0
- package/packages/diagrams/src/lib/templates/collaborationDiagram/CollaborationDiagram.tsx +16 -0
- package/packages/diagrams/src/lib/templates/collaborationDiagram/components/AddCollabEdgeDialog.tsx +182 -0
- package/packages/diagrams/src/lib/templates/collaborationDiagram/components/CollabLayout.ts +182 -0
- package/packages/diagrams/src/lib/templates/collaborationDiagram/components/CollabObjectNodeSettings.tsx +87 -0
- package/packages/diagrams/src/lib/templates/collaborationDiagram/components/CollaborationDiagramFlow.tsx +731 -0
- package/packages/diagrams/src/lib/templates/collaborationDiagram/components/DraggableEdgeLabel.tsx +124 -0
- package/packages/diagrams/src/lib/templates/collaborationDiagram/controls/CollaborationControls.tsx +132 -0
- package/packages/diagrams/src/lib/templates/collaborationDiagram/nodes/CollabEdge.tsx +171 -0
- package/packages/diagrams/src/lib/templates/collaborationDiagram/nodes/CollabObjectNode.tsx +179 -0
- package/packages/diagrams/src/lib/templates/home.style.css +16 -0
- package/packages/diagrams/src/lib/templates/node-forms/ApiForm.tsx +416 -0
- package/packages/diagrams/src/lib/templates/node-forms/CallForm.tsx +370 -0
- package/packages/diagrams/src/lib/templates/node-forms/ForLoopNode.tsx +313 -0
- package/packages/diagrams/src/lib/templates/node-forms/FunctionForm.tsx +211 -0
- package/packages/diagrams/src/lib/templates/node-forms/GraphQLForm.tsx +679 -0
- package/packages/diagrams/src/lib/templates/node-forms/IfNodeForm.tsx +97 -0
- package/packages/diagrams/src/lib/templates/node-forms/LetNodeForm.tsx +533 -0
- package/packages/diagrams/src/lib/templates/node-forms/LoopNode.tsx +149 -0
- package/packages/diagrams/src/lib/templates/node-forms/NodeForm.tsx +383 -0
- package/packages/diagrams/src/lib/templates/node-forms/ReturnNodeForm.tsx +96 -0
- package/packages/diagrams/src/lib/templates/node-forms/SetNodeForm.tsx +141 -0
- package/packages/diagrams/src/lib/templates/node-forms/SwitchNodeForm.tsx +249 -0
- package/packages/diagrams/src/lib/templates/node-forms/TryCatchForm.tsx +167 -0
- package/packages/diagrams/src/lib/templates/nodeFormSchema.json +84 -0
- package/packages/diagrams/src/lib/templates/sequence/SequenceDiagram.tsx +22 -0
- package/packages/diagrams/src/lib/templates/sequence/components/ActivationBarNode.tsx +33 -0
- package/packages/diagrams/src/lib/templates/sequence/components/AddMessageDialog.tsx +302 -0
- package/packages/diagrams/src/lib/templates/sequence/components/CombinedFragmentNode.tsx +65 -0
- package/packages/diagrams/src/lib/templates/sequence/components/EntitySettings.tsx +559 -0
- package/packages/diagrams/src/lib/templates/sequence/components/FragmentSettings.tsx +116 -0
- package/packages/diagrams/src/lib/templates/sequence/components/SequenceComponents.tsx +14 -0
- package/packages/diagrams/src/lib/templates/sequence/components/SequenceDiagramFlow.tsx +1361 -0
- package/packages/diagrams/src/lib/templates/sequence/components/SequenceEntityNode.tsx +394 -0
- package/packages/diagrams/src/lib/templates/sequence/components/SequenceMessageEdge.tsx +272 -0
- package/packages/diagrams/src/lib/templates/sequence/components/SimpleEntitySettings.tsx +90 -0
- package/packages/diagrams/src/lib/templates/sequence/controls/DiagramControls.tsx +707 -0
- package/packages/diagrams/src/lib/templates/sequence/data/template-data.ts +635 -0
- package/packages/diagrams/src/lib/templates/stateMachine/StateMachineDiagram.tsx +67 -0
- package/packages/diagrams/src/lib/templates/stateMachine/components/CompositeStateNodeSettings.tsx +639 -0
- package/packages/diagrams/src/lib/templates/stateMachine/components/CustomEdge.tsx +221 -0
- package/packages/diagrams/src/lib/templates/stateMachine/components/EdgeSettings.tsx +194 -0
- package/packages/diagrams/src/lib/templates/stateMachine/components/SelfConnectingEdge.tsx +42 -0
- package/packages/diagrams/src/lib/templates/stateMachine/components/StateMachineComponents.tsx +50 -0
- package/packages/diagrams/src/lib/templates/stateMachine/components/StateMachineDiagramFlow.tsx +1238 -0
- package/packages/diagrams/src/lib/templates/stateMachine/components/StateMachineLayout.ts +350 -0
- package/packages/diagrams/src/lib/templates/stateMachine/components/StateNodeSettings.tsx +189 -0
- package/packages/diagrams/src/lib/templates/stateMachine/components/useSelfTransition.ts +114 -0
- package/packages/diagrams/src/lib/templates/stateMachine/controls/StateDiagramControls.tsx +488 -0
- package/packages/diagrams/src/lib/templates/stateMachine/data/template-data.ts +4 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/ChoicePointNode.tsx +54 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/CompositeStateNode.tsx +225 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/EntryPointNode.tsx +31 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/ExitPointNode.tsx +44 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/FinalStateNode.tsx +41 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/ForkJoinNode.tsx +53 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/HistoryStateNode.tsx +36 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/InitialStateNode.tsx +29 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/JunctionPointNode.tsx +33 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/PinPointNode.tsx +112 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/StateNode.tsx +124 -0
- package/packages/diagrams/src/lib/templates/stateMachine/nodes/bendPoint.tsx +71 -0
- package/packages/diagrams/src/lib/templates/systemFlow/SystemFlowDiagram.tsx +67 -0
- package/packages/diagrams/src/lib/templates/systemFlow/components/EdgeSettings.tsx +330 -0
- package/packages/diagrams/src/lib/templates/systemFlow/components/FloatingEdge.tsx +219 -0
- package/packages/diagrams/src/lib/templates/systemFlow/components/SystemFlowComponents.tsx +28 -0
- package/packages/diagrams/src/lib/templates/systemFlow/components/SystemFlowDiagramFlow.tsx +1179 -0
- package/packages/diagrams/src/lib/templates/systemFlow/components/SystemFlowNodeSettings.tsx +151 -0
- package/packages/diagrams/src/lib/templates/systemFlow/controls/SystemFlowControls.tsx +435 -0
- package/packages/diagrams/src/lib/templates/systemFlow/data/template-data.ts +308 -0
- package/packages/diagrams/src/lib/templates/systemFlow/demo.tsx +91 -0
- package/packages/diagrams/src/lib/templates/systemFlow/index.ts +5 -0
- package/packages/diagrams/src/lib/templates/systemFlow/nodes/BendpointNode.tsx +80 -0
- package/packages/diagrams/src/lib/templates/systemFlow/nodes/SystemNode.tsx +92 -0
- package/packages/diagrams/src/lib/templates/systemFlow/nodes/TreeSystemNode.tsx +755 -0
- package/packages/diagrams/src/lib/templates/useCaseDiagram/UseCaseDiagram.tsx +16 -0
- package/packages/diagrams/src/lib/templates/useCaseDiagram/components/ActorNodeSettings.tsx +104 -0
- package/packages/diagrams/src/lib/templates/useCaseDiagram/components/AddRelationshipDialog.tsx +187 -0
- package/packages/diagrams/src/lib/templates/useCaseDiagram/components/PackageNodeSettings.tsx +206 -0
- package/packages/diagrams/src/lib/templates/useCaseDiagram/components/UseCaseDiagramFlow.tsx +637 -0
- package/packages/diagrams/src/lib/templates/useCaseDiagram/components/UseCaseNodeSettings.tsx +121 -0
- package/packages/diagrams/src/lib/templates/useCaseDiagram/controls/UseCaseControls.tsx +289 -0
- package/packages/diagrams/src/lib/templates/useCaseDiagram/nodes/PackageNode.tsx +84 -0
- package/packages/diagrams/src/lib/templates/useCaseDiagram/nodes/UseCaseEdge.tsx +116 -0
- package/packages/diagrams/src/lib/templates/useCaseDiagram/nodes/UseCaseNode.tsx +231 -0
- package/packages/diagrams/src/lib/templates/validationSchema.json +277 -0
- package/packages/diagrams/src/lib/theme.ts +439 -0
- package/packages/diagrams/src/lib/types/FunctionSignature.ts +11 -0
- package/packages/diagrams/src/lib/types/SmartDynamicFormField.ts +37 -0
- package/packages/diagrams/src/lib/types/automation-node-data-types.ts +295 -0
- package/packages/diagrams/src/lib/types/available-variables.ts +18 -0
- package/packages/diagrams/src/lib/types/card-node.ts +68 -0
- package/packages/diagrams/src/lib/types/collaboration-types.ts +114 -0
- package/packages/diagrams/src/lib/types/colors.ts +25 -0
- package/packages/diagrams/src/lib/types/condition-builder.ts +19 -0
- package/packages/diagrams/src/lib/types/diagram-types.ts +14 -0
- package/packages/diagrams/src/lib/types/edge-types.ts +22 -0
- package/packages/diagrams/src/lib/types/function-execution.ts +35 -0
- package/packages/diagrams/src/lib/types/hooks.types.ts +6 -0
- package/packages/diagrams/src/lib/types/ndoe-form-types.ts +139 -0
- package/packages/diagrams/src/lib/types/node-types.ts +29 -0
- package/packages/diagrams/src/lib/types/sequence-types.ts +178 -0
- package/packages/diagrams/src/lib/types/shared-node-types.ts +21 -0
- package/packages/diagrams/src/lib/types/state-machine-types.ts +225 -0
- package/packages/diagrams/src/lib/types/stencil-item.ts +7 -0
- package/packages/diagrams/src/lib/types/structures.ts +80 -0
- package/packages/diagrams/src/lib/types/system-flow-types.ts +129 -0
- package/packages/diagrams/src/lib/types/usecase-types.ts +84 -0
- package/packages/diagrams/src/lib/types/validation-types.ts +134 -0
- package/packages/diagrams/src/lib/types/workflow-content-dynamic-form-type.ts +23 -0
- package/packages/diagrams/src/lib/types/workflow-node-data-types.ts +172 -0
- package/packages/diagrams/src/lib/utils/AutomationExecutionEngine.ts +1162 -0
- package/packages/diagrams/src/lib/utils/add-new-block.ts +34 -0
- package/packages/diagrams/src/lib/utils/add-new-node.ts +52 -0
- package/packages/diagrams/src/lib/utils/addToHistory.ts +15 -0
- package/packages/diagrams/src/lib/utils/automation-flow-processor.ts +619 -0
- package/packages/diagrams/src/lib/utils/closestPoint.ts +45 -0
- package/packages/diagrams/src/lib/utils/color-options.tsx +26 -0
- package/packages/diagrams/src/lib/utils/compress-img.ts +59 -0
- package/packages/diagrams/src/lib/utils/configLoader.ts +329 -0
- package/packages/diagrams/src/lib/utils/constant-lengths.ts +8 -0
- package/packages/diagrams/src/lib/utils/create-updated.tsx +40 -0
- package/packages/diagrams/src/lib/utils/createHistoryChange.ts +3 -0
- package/packages/diagrams/src/lib/utils/dividerUtils.tsx +60 -0
- package/packages/diagrams/src/lib/utils/edge-hooks.ts +53 -0
- package/packages/diagrams/src/lib/utils/elkLayout.ts +297 -0
- package/packages/diagrams/src/lib/utils/event-hooks.ts +69 -0
- package/packages/diagrams/src/lib/utils/event-store.ts +58 -0
- package/packages/diagrams/src/lib/utils/flow-node-hooks.ts +28 -0
- package/packages/diagrams/src/lib/utils/flow-to-js.ts +1465 -0
- package/packages/diagrams/src/lib/utils/functionGenerator.ts +38 -0
- package/packages/diagrams/src/lib/utils/helpers.types.ts +10 -0
- package/packages/diagrams/src/lib/utils/iconMapper.tsx +76 -0
- package/packages/diagrams/src/lib/utils/logger.ts +5 -0
- package/packages/diagrams/src/lib/utils/model-hooks.ts +129 -0
- package/packages/diagrams/src/lib/utils/node-hooks.ts +78 -0
- package/packages/diagrams/src/lib/utils/nodeutils.ts +242 -0
- package/packages/diagrams/src/lib/utils/object.ts +13 -0
- package/packages/diagrams/src/lib/utils/useDebounce.ts +19 -0
- package/packages/diagrams/src/lib/utils/utilities.ts +105 -0
- package/packages/diagrams/src/lib/utils/validationEngine.ts +610 -0
- package/packages/diagrams/src/lib/utils/vhToPixels.ts +9 -0
- package/packages/diagrams/tsconfig.json +21 -0
- package/packages/diagrams/tsconfig.lib.json +27 -0
- package/packages/diagrams/webpack.config.js +17 -0
- package/packages/interfaces/.babelrc +12 -0
- package/packages/interfaces/.eslintrc.json +18 -0
- package/packages/interfaces/README.md +7 -0
- package/packages/interfaces/project.json +8 -0
- package/packages/interfaces/src/index.ts +21 -0
- package/packages/interfaces/src/lib/Button.tsx +1 -0
- package/packages/interfaces/src/lib/DataGrid.ts +14 -0
- package/packages/interfaces/src/lib/StyledBox.tsx +1 -0
- package/packages/interfaces/src/lib/ToolbarItem.ts +7 -0
- package/packages/interfaces/src/lib/UserCard.ts +8 -0
- package/packages/interfaces/src/lib/yup.ts +3 -0
- package/packages/interfaces/tsconfig.json +17 -0
- package/packages/interfaces/tsconfig.lib.json +24 -0
- package/packages/molecules/.babelrc +12 -0
- package/packages/molecules/.eslintrc.json +18 -0
- package/packages/molecules/README.md +7 -0
- package/packages/molecules/project.json +8 -0
- package/packages/molecules/src/index.ts +22 -0
- package/packages/molecules/src/lib/ActionTextField/ActionTextField.module.css +7 -0
- package/packages/molecules/src/lib/ActionTextField/ActionTextField.spec.tsx +10 -0
- package/packages/molecules/src/lib/ActionTextField/ActionTextField.tsx +33 -0
- package/packages/molecules/src/lib/ClosableButton/CloseableButton.module.css +7 -0
- package/packages/molecules/src/lib/ClosableButton/CloseableButton.spec.tsx +11 -0
- package/packages/molecules/src/lib/ClosableButton/CloseableButton.tsx +69 -0
- package/packages/molecules/src/lib/EditorTab/EditorTab.module.css +7 -0
- package/packages/molecules/src/lib/EditorTab/EditorTab.spec.tsx +10 -0
- package/packages/molecules/src/lib/EditorTab/EditorTab.tsx +42 -0
- package/packages/molecules/src/lib/EditorTab/TabPanel.tsx +25 -0
- package/packages/molecules/src/lib/ParamsActionField/ParamsActionField.module.css +7 -0
- package/packages/molecules/src/lib/ParamsActionField/ParamsActionField.spec.tsx +10 -0
- package/packages/molecules/src/lib/ParamsActionField/ParamsActionField.tsx +24 -0
- package/packages/molecules/src/lib/TableWithInlineView/TableWithInlineView.module.css +7 -0
- package/packages/molecules/src/lib/TableWithInlineView/TableWithInlineView.spec.tsx +10 -0
- package/packages/molecules/src/lib/TableWithInlineView/TableWithInlineView.tsx +47 -0
- package/packages/molecules/src/lib/UserCard/UserCard.module.css +7 -0
- package/packages/molecules/src/lib/UserCard/UserCard.spec.tsx +11 -0
- package/packages/molecules/src/lib/UserCard/UserCard.tsx +22 -0
- package/packages/molecules/src/lib/VerbSelection/HTTPVerbSelection.module.css +7 -0
- package/packages/molecules/src/lib/VerbSelection/HTTPVerbSelection.spec.tsx +10 -0
- package/packages/molecules/src/lib/VerbSelection/HTTPVerbSelection.tsx +72 -0
- package/packages/molecules/tsconfig.json +17 -0
- package/packages/molecules/tsconfig.lib.json +30 -0
- package/packages/organisms/.babelrc +12 -0
- package/packages/organisms/.eslintrc.json +18 -0
- package/packages/organisms/README.md +7 -0
- package/packages/organisms/project.json +8 -0
- package/packages/organisms/src/index.ts +4 -0
- package/packages/organisms/src/lib/EditorToolbar/EditorToolbar.module.css +7 -0
- package/packages/organisms/src/lib/EditorToolbar/EditorToolbar.spec.tsx +10 -0
- package/packages/organisms/src/lib/EditorToolbar/EditorToolbar.tsx +117 -0
- package/packages/organisms/src/lib/EditorToolbar/SortableItem.tsx +51 -0
- package/packages/organisms/src/lib/UserList/UserList.module.css +7 -0
- package/packages/organisms/src/lib/UserList/UserList.spec.tsx +11 -0
- package/packages/organisms/src/lib/UserList/UserList.tsx +48 -0
- package/packages/organisms/src/lib/UserList/store.ts +49 -0
- package/packages/organisms/tsconfig.json +17 -0
- package/packages/organisms/tsconfig.lib.json +24 -0
- package/packages/zustand/.babelrc +12 -0
- package/packages/zustand/.eslintrc.json +18 -0
- package/packages/zustand/README.md +7 -0
- package/packages/zustand/project.json +8 -0
- package/packages/zustand/src/index.ts +4 -0
- package/packages/zustand/tsconfig.json +17 -0
- package/packages/zustand/tsconfig.lib.json +24 -0
- package/tsconfig.base.json +30 -0
|
@@ -0,0 +1,1465 @@
|
|
|
1
|
+
import { Edge } from '@xyflow/react';
|
|
2
|
+
import { ICardNode as _ICardNode } from '../types/card-node';
|
|
3
|
+
import { FunctionParameter } from '../templates/node-forms/FunctionForm';
|
|
4
|
+
import {
|
|
5
|
+
Expression,
|
|
6
|
+
OperationExpression,
|
|
7
|
+
} from '../types/workflow-node-data-types';
|
|
8
|
+
import { CallFormData } from '../types/function-execution';
|
|
9
|
+
import { RuleGroup } from '../types/condition-builder';
|
|
10
|
+
|
|
11
|
+
type ICardNode = _ICardNode;
|
|
12
|
+
|
|
13
|
+
export interface MiddleSchema {
|
|
14
|
+
id?: string;
|
|
15
|
+
true?: (MiddleSchema | undefined)[];
|
|
16
|
+
false?: (MiddleSchema | undefined)[];
|
|
17
|
+
body?: (MiddleSchema | undefined)[];
|
|
18
|
+
type: string;
|
|
19
|
+
variable?: Expression;
|
|
20
|
+
value?: Expression;
|
|
21
|
+
condition?: Expression;
|
|
22
|
+
conditions?: RuleGroup; // Add support for multiple conditions
|
|
23
|
+
parameters?: (string | FunctionParameter)[];
|
|
24
|
+
name?: string;
|
|
25
|
+
customCode?: string;
|
|
26
|
+
bindings?: [string, Expression][];
|
|
27
|
+
mode?: 'simple' | 'object' | 'code'; // Add mode for let node
|
|
28
|
+
objectDefinition?: any; // Add object definition for let node
|
|
29
|
+
catchBlock?: MiddleSchema;
|
|
30
|
+
init?: string;
|
|
31
|
+
update?: string;
|
|
32
|
+
switchValue?: string;
|
|
33
|
+
errorVar?: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
dataType?: string;
|
|
36
|
+
valueDataType?: string;
|
|
37
|
+
conditionDataType?: string;
|
|
38
|
+
initDataType?: string;
|
|
39
|
+
updateDataType?: string;
|
|
40
|
+
// Add function call specific fields
|
|
41
|
+
functionName?: string;
|
|
42
|
+
args?: Array<{ name: string; value: string; dataType?: string }>;
|
|
43
|
+
returnValueName?: string;
|
|
44
|
+
returnValueDataType?: string;
|
|
45
|
+
// Add flag to identify function call nodes
|
|
46
|
+
isFunctionCall?: boolean;
|
|
47
|
+
// Add API node specific fields
|
|
48
|
+
method?: string;
|
|
49
|
+
url?: string;
|
|
50
|
+
headers?: Array<{ key: string; value: string; enabled: boolean }>;
|
|
51
|
+
queryParams?: Array<{ key: string; value: string; enabled: boolean }>;
|
|
52
|
+
requestBody?: string;
|
|
53
|
+
bodyType?: string;
|
|
54
|
+
responseVariable?: string;
|
|
55
|
+
responseDataType?: string;
|
|
56
|
+
// Add GraphQL node specific fields
|
|
57
|
+
graphqlMode?: string;
|
|
58
|
+
operationType?: string;
|
|
59
|
+
operationName?: string;
|
|
60
|
+
rootField?: string;
|
|
61
|
+
arguments?: Array<{ key: string; value: string }>;
|
|
62
|
+
fields?: Array<{ name: string; subFields?: Array<{ name: string }> }>;
|
|
63
|
+
variables?: Array<{ key: string; value: string; type: string }>;
|
|
64
|
+
customQuery?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const flowToCode = (json: { nodes: ICardNode[]; edges: Edge[] }) => {
|
|
68
|
+
const externalFunctions: string[] = [];
|
|
69
|
+
// Clone the JSON without processed flag
|
|
70
|
+
const clonedJson = {
|
|
71
|
+
nodes: json.nodes.map((node) => ({ ...node })),
|
|
72
|
+
edges: json.edges.map((edge) => ({ ...edge })),
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// Track processed nodes to prevent duplicates
|
|
76
|
+
const processedNodes = new Set<string>();
|
|
77
|
+
|
|
78
|
+
// --- Move processNode and createBlockFlow above jsonToJavaScript for scope ---
|
|
79
|
+
const processNode = (
|
|
80
|
+
n: ICardNode,
|
|
81
|
+
visited: Set<string>,
|
|
82
|
+
): MiddleSchema | undefined => {
|
|
83
|
+
if (!n || visited.has(n.id) || processedNodes.has(n.id)) return;
|
|
84
|
+
visited.add(n.id);
|
|
85
|
+
processedNodes.add(n.id);
|
|
86
|
+
|
|
87
|
+
// Determine the node type based on data structure
|
|
88
|
+
let nodeType = n.data.formData?.type || n.data.type || 'emptyNode';
|
|
89
|
+
|
|
90
|
+
// Check if this is a function call node based on data structure
|
|
91
|
+
let isFunctionCall = false;
|
|
92
|
+
if (
|
|
93
|
+
n.data.formData &&
|
|
94
|
+
('functionName' in n.data.formData || 'args' in n.data.formData)
|
|
95
|
+
) {
|
|
96
|
+
isFunctionCall = true;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const res: MiddleSchema = {
|
|
100
|
+
id: n.id,
|
|
101
|
+
type: nodeType,
|
|
102
|
+
title: n.data.title,
|
|
103
|
+
isFunctionCall,
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// Debug type assignment for function nodes
|
|
107
|
+
if (n.data.formData?.type === 'function') {
|
|
108
|
+
console.log('Function node type assignment:', {
|
|
109
|
+
id: n.id,
|
|
110
|
+
title: n.data.title,
|
|
111
|
+
formDataType: n.data.formData?.type,
|
|
112
|
+
dataType: n.data.type,
|
|
113
|
+
assignedType: res.type,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Add compatible properties from formData based on node type
|
|
118
|
+
if (n.data.formData) {
|
|
119
|
+
const formData = n.data.formData;
|
|
120
|
+
|
|
121
|
+
// Add properties that are directly compatible with MiddleSchema
|
|
122
|
+
if ('name' in formData) res.name = formData.name as string;
|
|
123
|
+
if ('parameters' in formData) {
|
|
124
|
+
// Handle both old string[] format and new FunctionParameter[] format
|
|
125
|
+
const params = formData.parameters;
|
|
126
|
+
if (Array.isArray(params)) {
|
|
127
|
+
if (params.length > 0 && typeof params[0] === 'string') {
|
|
128
|
+
// Old format: string[]
|
|
129
|
+
res.parameters = params as (string | FunctionParameter)[];
|
|
130
|
+
} else if (
|
|
131
|
+
params.length > 0 &&
|
|
132
|
+
typeof params[0] === 'object' &&
|
|
133
|
+
'name' in params[0]
|
|
134
|
+
) {
|
|
135
|
+
// New format: FunctionParameter[]
|
|
136
|
+
res.parameters = params as (string | FunctionParameter)[];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if ('variable' in formData)
|
|
141
|
+
res.variable = formData.variable as Expression;
|
|
142
|
+
if ('value' in formData) res.value = formData.value as Expression;
|
|
143
|
+
if ('condition' in formData)
|
|
144
|
+
res.condition = formData.condition as Expression;
|
|
145
|
+
if ('bindings' in formData)
|
|
146
|
+
res.bindings = formData.bindings as [string, Expression][];
|
|
147
|
+
if ('mode' in formData)
|
|
148
|
+
res.mode = formData.mode as 'simple' | 'object' | 'code';
|
|
149
|
+
if ('objectDefinition' in formData)
|
|
150
|
+
res.objectDefinition = formData.objectDefinition as any;
|
|
151
|
+
if ('customCode' in formData) {
|
|
152
|
+
res.customCode = formData.customCode as string;
|
|
153
|
+
if (formData.type === 'function') {
|
|
154
|
+
console.log('Extracted custom code from function formData:', {
|
|
155
|
+
functionName: res.name,
|
|
156
|
+
customCode: res.customCode,
|
|
157
|
+
customCodeLength: res.customCode?.length,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if ('init' in formData) {
|
|
162
|
+
if (typeof formData.init === 'string') {
|
|
163
|
+
res.init = formData.init;
|
|
164
|
+
} else if (
|
|
165
|
+
typeof formData.init === 'object' &&
|
|
166
|
+
'operation' in formData.init
|
|
167
|
+
) {
|
|
168
|
+
// Convert operation expression to string representation
|
|
169
|
+
const op = formData.init as { operation: string; operands: string[] };
|
|
170
|
+
// Handle special operators that need different formatting
|
|
171
|
+
switch (op.operation) {
|
|
172
|
+
case '=':
|
|
173
|
+
// Assignment operator - no parentheses needed
|
|
174
|
+
res.init =
|
|
175
|
+
`${op.operands[0] || ''} = ${op.operands[1] || ''}`.trim();
|
|
176
|
+
break;
|
|
177
|
+
case '==':
|
|
178
|
+
case '!=':
|
|
179
|
+
// Equality operators - use parentheses for clarity
|
|
180
|
+
res.init =
|
|
181
|
+
`(${op.operands[0] || ''} ${op.operation} ${op.operands[1] || ''})`.trim();
|
|
182
|
+
break;
|
|
183
|
+
default:
|
|
184
|
+
// All other operators - use parentheses
|
|
185
|
+
res.init =
|
|
186
|
+
`(${op.operands[0] || ''} ${op.operation} ${op.operands[1] || ''})`.trim();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if ('update' in formData) {
|
|
191
|
+
if (typeof formData.update === 'string') {
|
|
192
|
+
res.update = formData.update;
|
|
193
|
+
} else if (
|
|
194
|
+
typeof formData.update === 'object' &&
|
|
195
|
+
'operation' in formData.update
|
|
196
|
+
) {
|
|
197
|
+
// Convert operation expression to string representation
|
|
198
|
+
const op = formData.update as {
|
|
199
|
+
operation: string;
|
|
200
|
+
operands: string[];
|
|
201
|
+
};
|
|
202
|
+
// Handle special operators that need different formatting
|
|
203
|
+
switch (op.operation) {
|
|
204
|
+
case '=':
|
|
205
|
+
// Assignment operator - no parentheses needed
|
|
206
|
+
res.update =
|
|
207
|
+
`${op.operands[0] || ''} = ${op.operands[1] || ''}`.trim();
|
|
208
|
+
break;
|
|
209
|
+
case '==':
|
|
210
|
+
case '!=':
|
|
211
|
+
// Equality operators - use parentheses for clarity
|
|
212
|
+
res.update =
|
|
213
|
+
`(${op.operands[0] || ''} ${op.operation} ${op.operands[1] || ''})`.trim();
|
|
214
|
+
break;
|
|
215
|
+
default:
|
|
216
|
+
// All other operators - use parentheses
|
|
217
|
+
res.update =
|
|
218
|
+
`(${op.operands[0] || ''} ${op.operation} ${op.operands[1] || ''})`.trim();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if ('switchValue' in formData) {
|
|
223
|
+
if (typeof formData.switchValue === 'string') {
|
|
224
|
+
res.switchValue = formData.switchValue;
|
|
225
|
+
} else if (
|
|
226
|
+
typeof formData.switchValue === 'object' &&
|
|
227
|
+
'operation' in formData.switchValue
|
|
228
|
+
) {
|
|
229
|
+
// Convert operation expression to string representation
|
|
230
|
+
const op = formData.switchValue as {
|
|
231
|
+
operation: string;
|
|
232
|
+
operands: string[];
|
|
233
|
+
};
|
|
234
|
+
// Handle special operators that need different formatting
|
|
235
|
+
switch (op.operation) {
|
|
236
|
+
case '=':
|
|
237
|
+
// Assignment operator - no parentheses needed
|
|
238
|
+
res.switchValue =
|
|
239
|
+
`${op.operands[0] || ''} = ${op.operands[1] || ''}`.trim();
|
|
240
|
+
break;
|
|
241
|
+
case '==':
|
|
242
|
+
case '!=':
|
|
243
|
+
// Equality operators - use parentheses for clarity
|
|
244
|
+
res.switchValue =
|
|
245
|
+
`(${op.operands[0] || ''} ${op.operation} ${op.operands[1] || ''})`.trim();
|
|
246
|
+
break;
|
|
247
|
+
default:
|
|
248
|
+
// All other operators - use parentheses
|
|
249
|
+
res.switchValue =
|
|
250
|
+
`(${op.operands[0] || ''} ${op.operation} ${op.operands[1] || ''})`.trim();
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if ('errorVar' in formData) res.errorVar = formData.errorVar as string;
|
|
255
|
+
if ('dataType' in formData) res.dataType = formData.dataType as string;
|
|
256
|
+
if ('valueDataType' in formData)
|
|
257
|
+
res.valueDataType = formData.valueDataType as string;
|
|
258
|
+
if ('conditionDataType' in formData)
|
|
259
|
+
res.conditionDataType = formData.conditionDataType as string;
|
|
260
|
+
if ('initDataType' in formData)
|
|
261
|
+
res.initDataType = formData.initDataType as string;
|
|
262
|
+
if ('updateDataType' in formData)
|
|
263
|
+
res.updateDataType = formData.updateDataType as string;
|
|
264
|
+
|
|
265
|
+
// Handle function call specific properties
|
|
266
|
+
if ('functionName' in formData)
|
|
267
|
+
res.functionName = formData.functionName as string;
|
|
268
|
+
if ('args' in formData) {
|
|
269
|
+
res.args = (
|
|
270
|
+
formData.args as Array<{
|
|
271
|
+
name: string;
|
|
272
|
+
value: string | { operation: string; operands: string[] };
|
|
273
|
+
dataType?: string;
|
|
274
|
+
}>
|
|
275
|
+
).map((arg) => ({
|
|
276
|
+
name: arg.name,
|
|
277
|
+
value:
|
|
278
|
+
typeof arg.value === 'string'
|
|
279
|
+
? arg.value
|
|
280
|
+
: (() => {
|
|
281
|
+
const op = arg.value as {
|
|
282
|
+
operation: string;
|
|
283
|
+
operands: string[];
|
|
284
|
+
};
|
|
285
|
+
// Handle special operators that need different formatting
|
|
286
|
+
switch (op.operation) {
|
|
287
|
+
case '=':
|
|
288
|
+
// Assignment operator - no parentheses needed
|
|
289
|
+
return `${op.operands[0] || ''} = ${op.operands[1] || ''}`.trim();
|
|
290
|
+
case '==':
|
|
291
|
+
case '!=':
|
|
292
|
+
// Equality operators - use parentheses for clarity
|
|
293
|
+
return `(${op.operands[0] || ''} ${op.operation} ${op.operands[1] || ''})`.trim();
|
|
294
|
+
default:
|
|
295
|
+
// All other operators - use parentheses
|
|
296
|
+
return `(${op.operands[0] || ''} ${op.operation} ${op.operands[1] || ''})`.trim();
|
|
297
|
+
}
|
|
298
|
+
})(),
|
|
299
|
+
dataType: arg.dataType,
|
|
300
|
+
}));
|
|
301
|
+
}
|
|
302
|
+
if ('returnValueName' in formData && formData.returnValueName) {
|
|
303
|
+
if (typeof formData.returnValueName === 'string') {
|
|
304
|
+
res.returnValueName = formData.returnValueName;
|
|
305
|
+
} else if (
|
|
306
|
+
typeof formData.returnValueName === 'object' &&
|
|
307
|
+
'operation' in formData.returnValueName
|
|
308
|
+
) {
|
|
309
|
+
// Convert operation expression to string representation
|
|
310
|
+
const op = formData.returnValueName as {
|
|
311
|
+
operation: string;
|
|
312
|
+
operands: string[];
|
|
313
|
+
};
|
|
314
|
+
// Handle special operators that need different formatting
|
|
315
|
+
switch (op.operation) {
|
|
316
|
+
case '=':
|
|
317
|
+
// Assignment operator - no parentheses needed
|
|
318
|
+
res.returnValueName =
|
|
319
|
+
`${op.operands[0] || ''} = ${op.operands[1] || ''}`.trim();
|
|
320
|
+
break;
|
|
321
|
+
case '==':
|
|
322
|
+
case '!=':
|
|
323
|
+
// Equality operators - use parentheses for clarity
|
|
324
|
+
res.returnValueName =
|
|
325
|
+
`(${op.operands[0] || ''} ${op.operation} ${op.operands[1] || ''})`.trim();
|
|
326
|
+
break;
|
|
327
|
+
default:
|
|
328
|
+
// All other operators - use parentheses
|
|
329
|
+
res.returnValueName =
|
|
330
|
+
`(${op.operands[0] || ''} ${op.operation} ${op.operands[1] || ''})`.trim();
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if ('returnValueDataType' in formData)
|
|
335
|
+
res.returnValueDataType = formData.returnValueDataType as string;
|
|
336
|
+
|
|
337
|
+
// Handle API node specific properties
|
|
338
|
+
if ('method' in formData) res.method = formData.method as string;
|
|
339
|
+
if ('url' in formData) res.url = formData.url as string;
|
|
340
|
+
if ('headers' in formData)
|
|
341
|
+
res.headers = formData.headers as Array<{
|
|
342
|
+
key: string;
|
|
343
|
+
value: string;
|
|
344
|
+
enabled: boolean;
|
|
345
|
+
}>;
|
|
346
|
+
if ('queryParams' in formData)
|
|
347
|
+
res.queryParams = formData.queryParams as Array<{
|
|
348
|
+
key: string;
|
|
349
|
+
value: string;
|
|
350
|
+
enabled: boolean;
|
|
351
|
+
}>;
|
|
352
|
+
if ('body' in formData) res.requestBody = formData.body as string;
|
|
353
|
+
if ('bodyType' in formData) res.bodyType = formData.bodyType as string;
|
|
354
|
+
if ('responseVariable' in formData)
|
|
355
|
+
res.responseVariable = formData.responseVariable as string;
|
|
356
|
+
if ('responseDataType' in formData)
|
|
357
|
+
res.responseDataType = formData.responseDataType as string;
|
|
358
|
+
|
|
359
|
+
// Handle GraphQL node specific properties
|
|
360
|
+
if ('mode' in formData) res.graphqlMode = formData.mode as string;
|
|
361
|
+
if ('operationType' in formData)
|
|
362
|
+
res.operationType = formData.operationType as string;
|
|
363
|
+
if ('operationName' in formData)
|
|
364
|
+
res.operationName = formData.operationName as string;
|
|
365
|
+
if ('rootField' in formData) res.rootField = formData.rootField as string;
|
|
366
|
+
if ('arguments' in formData)
|
|
367
|
+
res.arguments = formData.arguments as Array<{
|
|
368
|
+
key: string;
|
|
369
|
+
value: string;
|
|
370
|
+
}>;
|
|
371
|
+
if ('fields' in formData)
|
|
372
|
+
res.fields = formData.fields as Array<{
|
|
373
|
+
name: string;
|
|
374
|
+
subFields?: Array<{
|
|
375
|
+
name: string;
|
|
376
|
+
}>;
|
|
377
|
+
}>;
|
|
378
|
+
if ('variables' in formData)
|
|
379
|
+
res.variables = formData.variables as Array<{
|
|
380
|
+
key: string;
|
|
381
|
+
value: string;
|
|
382
|
+
type: string;
|
|
383
|
+
}>;
|
|
384
|
+
if ('customQuery' in formData)
|
|
385
|
+
res.customQuery = formData.customQuery as string;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// Handle conditions from node data (RuleGroup format)
|
|
389
|
+
if (n.data.conditions) {
|
|
390
|
+
res.conditions = n.data.conditions as RuleGroup;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// Handle branch nodes (true/false cases)
|
|
394
|
+
const isBranchRoot = n.data.branchRoot === n.id;
|
|
395
|
+
if (isBranchRoot) {
|
|
396
|
+
const trueCase = clonedJson.nodes.find(
|
|
397
|
+
(node: ICardNode) => n.data.trueCase === node.id,
|
|
398
|
+
);
|
|
399
|
+
if (trueCase) {
|
|
400
|
+
res.true = createBlockFlow(trueCase, visited);
|
|
401
|
+
}
|
|
402
|
+
const falseCase = clonedJson.nodes.find(
|
|
403
|
+
(node: ICardNode) => n.data.falseCase === node.id,
|
|
404
|
+
);
|
|
405
|
+
if (falseCase) {
|
|
406
|
+
res.false = createBlockFlow(falseCase, visited);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Handle try/catch nodes
|
|
411
|
+
if (n.data.type === 'try') {
|
|
412
|
+
// Only process catch block via edges if we don't already have child nodes
|
|
413
|
+
// Child nodes are processed above in the general child node handling
|
|
414
|
+
if (!res.body || res.body.length === 0) {
|
|
415
|
+
// Outgoing edges: one to body, one to catch
|
|
416
|
+
const outgoingEdges = clonedJson.edges.filter(
|
|
417
|
+
(edge: Edge) => edge.source === n.id,
|
|
418
|
+
);
|
|
419
|
+
|
|
420
|
+
// Body edge: not to a catch node
|
|
421
|
+
const bodyEdge = outgoingEdges.find((edge: Edge) => {
|
|
422
|
+
const targetNode = clonedJson.nodes.find(
|
|
423
|
+
(node: ICardNode) => node.id === edge.target,
|
|
424
|
+
);
|
|
425
|
+
return targetNode && targetNode.data.type !== 'catch';
|
|
426
|
+
});
|
|
427
|
+
if (bodyEdge) {
|
|
428
|
+
const bodyNode = clonedJson.nodes.find(
|
|
429
|
+
(node: ICardNode) => node.id === bodyEdge.target,
|
|
430
|
+
);
|
|
431
|
+
if (bodyNode) {
|
|
432
|
+
res.body = createBlockFlow(bodyNode, visited);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
// Catch edge: to a catch node
|
|
438
|
+
const catchEdge = clonedJson.edges.find((edge: Edge) => {
|
|
439
|
+
return (
|
|
440
|
+
edge.source === n.id &&
|
|
441
|
+
clonedJson.nodes.find(
|
|
442
|
+
(node: ICardNode) =>
|
|
443
|
+
node.id === edge.target && node.data.type === 'catch',
|
|
444
|
+
)
|
|
445
|
+
);
|
|
446
|
+
});
|
|
447
|
+
if (catchEdge) {
|
|
448
|
+
const catchNode = clonedJson.nodes.find(
|
|
449
|
+
(node: ICardNode) => node.id === catchEdge.target,
|
|
450
|
+
);
|
|
451
|
+
if (catchNode) {
|
|
452
|
+
// Create a new visited set for the catch node to avoid conflicts
|
|
453
|
+
const catchVisited = new Set(visited);
|
|
454
|
+
// Remove the catch node from visited set if it's already there
|
|
455
|
+
catchVisited.delete(catchNode.id);
|
|
456
|
+
res.catchBlock = processNode(catchNode, catchVisited);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// Handle switch/case nodes
|
|
462
|
+
if (n.data.type === 'switch' || n.data.formData?.type === 'switch') {
|
|
463
|
+
// All outgoing edges are to case or default nodes
|
|
464
|
+
const caseEdges = clonedJson.edges.filter(
|
|
465
|
+
(edge: Edge) => edge.source === n.id,
|
|
466
|
+
);
|
|
467
|
+
|
|
468
|
+
// Create case node schemas directly without calling processNode to avoid conflicts
|
|
469
|
+
res.body = caseEdges
|
|
470
|
+
.map((edge: Edge) => {
|
|
471
|
+
const caseNode = clonedJson.nodes.find(
|
|
472
|
+
(node: ICardNode) => edge.target === node.id,
|
|
473
|
+
);
|
|
474
|
+
if (caseNode) {
|
|
475
|
+
// Create case node schema directly
|
|
476
|
+
const caseSchema: MiddleSchema = {
|
|
477
|
+
id: caseNode.id,
|
|
478
|
+
type: 'case',
|
|
479
|
+
title: caseNode.data.title || '',
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
const caseChildNodes = clonedJson.nodes.filter(
|
|
483
|
+
(childNode: ICardNode) => {
|
|
484
|
+
return childNode.parentId === caseNode.id;
|
|
485
|
+
},
|
|
486
|
+
);
|
|
487
|
+
|
|
488
|
+
if (caseChildNodes.length > 0) {
|
|
489
|
+
// Process child nodes as body of the case
|
|
490
|
+
caseSchema.body = caseChildNodes
|
|
491
|
+
.map((childNode) => processNode(childNode, visited))
|
|
492
|
+
.filter(Boolean);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
return caseSchema;
|
|
496
|
+
}
|
|
497
|
+
return undefined;
|
|
498
|
+
})
|
|
499
|
+
.filter(Boolean);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// Handle nodes that can have child nodes (nested scope)
|
|
503
|
+
// These are nodes that can contain other nodes within their scope
|
|
504
|
+
if (['forLoop', 'loop', 'catch', 'try'].includes(n.data.type || '')) {
|
|
505
|
+
// Find child nodes (nodes that have this node as parent)
|
|
506
|
+
const childNodes = clonedJson.nodes.filter((node: ICardNode) => {
|
|
507
|
+
return node.parentId === n.id;
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
if (childNodes.length > 0) {
|
|
511
|
+
// Process child nodes as body of this node
|
|
512
|
+
res.body = childNodes
|
|
513
|
+
.map((childNode) => processNode(childNode, visited))
|
|
514
|
+
.filter(Boolean);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return res;
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
const createBlockFlow = (
|
|
522
|
+
firstNode: ICardNode,
|
|
523
|
+
visited: Set<string>,
|
|
524
|
+
stopAtFunctions: boolean = false,
|
|
525
|
+
): (MiddleSchema | undefined)[] => {
|
|
526
|
+
const flow: (MiddleSchema | undefined)[] = [];
|
|
527
|
+
let currentNode: ICardNode | undefined = firstNode;
|
|
528
|
+
|
|
529
|
+
while (currentNode) {
|
|
530
|
+
// Skip catch nodes in linear flow - they should only be processed by try nodes
|
|
531
|
+
if (currentNode.data.type === 'catch') {
|
|
532
|
+
break;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// Stop if we encounter another function node (when stopAtFunctions is true)
|
|
536
|
+
if (stopAtFunctions && currentNode.data.formData?.type === 'function') {
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// Skip if already processed
|
|
541
|
+
if (processedNodes.has(currentNode.id)) {
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
const nodeResult = processNode(currentNode, visited);
|
|
546
|
+
if (!nodeResult) break;
|
|
547
|
+
flow.push(nodeResult);
|
|
548
|
+
|
|
549
|
+
// Find next node in the flow (edge-connected, same level)
|
|
550
|
+
let edgesNext = clonedJson.edges.filter(
|
|
551
|
+
(edge: Edge) => edge.source === currentNode?.id,
|
|
552
|
+
);
|
|
553
|
+
|
|
554
|
+
// Handle branch final node
|
|
555
|
+
const isBranchRoot: boolean =
|
|
556
|
+
currentNode.data.branchRoot === currentNode.id;
|
|
557
|
+
let finalNodeId: ICardNode | undefined =
|
|
558
|
+
isBranchRoot && currentNode.data.finalNodeId
|
|
559
|
+
? clonedJson.nodes.find(
|
|
560
|
+
(n: ICardNode) => currentNode?.data.finalNodeId === n.id,
|
|
561
|
+
)
|
|
562
|
+
: undefined;
|
|
563
|
+
|
|
564
|
+
if (finalNodeId) {
|
|
565
|
+
currentNode = finalNodeId;
|
|
566
|
+
continue;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
// Follow edge to next node (same level)
|
|
570
|
+
if (edgesNext.length === 1) {
|
|
571
|
+
const edge = edgesNext[0];
|
|
572
|
+
const nextNode = clonedJson.nodes.find(
|
|
573
|
+
(node: ICardNode) => edge.target === node.id,
|
|
574
|
+
);
|
|
575
|
+
if (nextNode) {
|
|
576
|
+
const previousEdgesOfNextNode = clonedJson.edges.filter(
|
|
577
|
+
(edge: Edge) => edge.target === nextNode?.id,
|
|
578
|
+
);
|
|
579
|
+
if (previousEdgesOfNextNode.length === 1) {
|
|
580
|
+
currentNode = nextNode;
|
|
581
|
+
continue;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
587
|
+
return flow;
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
// Helper function to find nodes that belong to a specific function
|
|
591
|
+
const findNodesBelongingToFunction = (
|
|
592
|
+
functionNode: ICardNode,
|
|
593
|
+
allNodes: ICardNode[],
|
|
594
|
+
allEdges: Edge[],
|
|
595
|
+
excludedFunctionIds: string[],
|
|
596
|
+
): (MiddleSchema | undefined)[] => {
|
|
597
|
+
// Find the first node that's connected to this function
|
|
598
|
+
const firstConnectedNode = allEdges
|
|
599
|
+
.filter((edge) => edge.source === functionNode.id)
|
|
600
|
+
.map((edge) => allNodes.find((n) => n.id === edge.target))
|
|
601
|
+
.find((node) => node && node.data.formData?.type !== 'function');
|
|
602
|
+
|
|
603
|
+
if (!firstConnectedNode) {
|
|
604
|
+
return [];
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// Use createBlockFlow to get the proper flow of nodes
|
|
608
|
+
// This will handle all the control structures and nested flows correctly
|
|
609
|
+
const visited = new Set<string>();
|
|
610
|
+
visited.add(functionNode.id); // Mark function node as visited to avoid processing it
|
|
611
|
+
|
|
612
|
+
const result = createBlockFlow(firstConnectedNode, visited, true); // Stop at functions to prevent overlap
|
|
613
|
+
|
|
614
|
+
return result;
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
function jsonToJavaScript(json: MiddleSchema) {
|
|
618
|
+
function parseNode(node: MiddleSchema): string {
|
|
619
|
+
switch (node.type) {
|
|
620
|
+
case 'emptyNode':
|
|
621
|
+
return '';
|
|
622
|
+
case 'function':
|
|
623
|
+
return parseFunction(node);
|
|
624
|
+
case 'call':
|
|
625
|
+
return parseCall(node);
|
|
626
|
+
case 'branch':
|
|
627
|
+
return parseBranch(node);
|
|
628
|
+
case 'let':
|
|
629
|
+
return parseLet(node);
|
|
630
|
+
case 'loop':
|
|
631
|
+
return parseLoop(node);
|
|
632
|
+
case 'forLoop':
|
|
633
|
+
return parseForLoop(node);
|
|
634
|
+
case 'set':
|
|
635
|
+
return parseSet(node);
|
|
636
|
+
case 'return':
|
|
637
|
+
return parseReturn(node);
|
|
638
|
+
case 'try':
|
|
639
|
+
return parseTry(node);
|
|
640
|
+
case 'catch':
|
|
641
|
+
return parseCatch(node);
|
|
642
|
+
case 'switch':
|
|
643
|
+
return parseSwitch(node);
|
|
644
|
+
case 'case':
|
|
645
|
+
return parseCaseNode(node);
|
|
646
|
+
case 'api':
|
|
647
|
+
return parseApi(node);
|
|
648
|
+
case 'graphql':
|
|
649
|
+
return parseGraphQL(node);
|
|
650
|
+
default:
|
|
651
|
+
// Check if this node has function call properties even if type is not 'call'
|
|
652
|
+
if (node.isFunctionCall || (node.functionName && node.args)) {
|
|
653
|
+
return parseCall(node);
|
|
654
|
+
}
|
|
655
|
+
throw new Error(`Unknown node type: ${node.type}`);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
const parseCall = (node: MiddleSchema): string => {
|
|
660
|
+
// Extract function call data from the node
|
|
661
|
+
const functionName = node.functionName || 'unknownFunction';
|
|
662
|
+
const args = node.args || [];
|
|
663
|
+
const returnValueName = node.returnValueName || '';
|
|
664
|
+
|
|
665
|
+
// Extract arguments' values, providing a default empty string if value is undefined
|
|
666
|
+
const argValues = args.map(
|
|
667
|
+
(arg: { name: string; value: string; dataType?: string }) => {
|
|
668
|
+
// If the value is empty, use the name as a variable reference
|
|
669
|
+
if (arg.value && arg.value.trim() !== '') {
|
|
670
|
+
// Format the value based on data type
|
|
671
|
+
const value = arg.value.trim();
|
|
672
|
+
const dataType = arg.dataType || 'String';
|
|
673
|
+
|
|
674
|
+
switch (dataType) {
|
|
675
|
+
case 'String':
|
|
676
|
+
case 'STRING':
|
|
677
|
+
case 'CHAR':
|
|
678
|
+
case 'TEXT':
|
|
679
|
+
// For string types, always wrap in quotes unless it's already quoted
|
|
680
|
+
if (
|
|
681
|
+
(value.startsWith('"') && value.endsWith('"')) ||
|
|
682
|
+
(value.startsWith("'") && value.endsWith("'"))
|
|
683
|
+
) {
|
|
684
|
+
return value; // Already quoted
|
|
685
|
+
}
|
|
686
|
+
return `'${value}'`;
|
|
687
|
+
case 'Number':
|
|
688
|
+
case 'INT':
|
|
689
|
+
case 'FLOAT':
|
|
690
|
+
// For number types, ensure it's not quoted
|
|
691
|
+
return value;
|
|
692
|
+
case 'Boolean':
|
|
693
|
+
case 'BOOLEAN':
|
|
694
|
+
// For boolean types, ensure it's not quoted
|
|
695
|
+
return value;
|
|
696
|
+
case 'Object':
|
|
697
|
+
// For object type, try to parse as JSON or wrap in quotes if it's a string
|
|
698
|
+
try {
|
|
699
|
+
JSON.parse(value);
|
|
700
|
+
return value; // Valid JSON
|
|
701
|
+
} catch {
|
|
702
|
+
return `'${value}'`; // Not valid JSON, treat as string
|
|
703
|
+
}
|
|
704
|
+
case 'Array':
|
|
705
|
+
// For array type, try to parse as JSON or wrap in quotes if it's a string
|
|
706
|
+
try {
|
|
707
|
+
JSON.parse(value);
|
|
708
|
+
return value; // Valid JSON
|
|
709
|
+
} catch {
|
|
710
|
+
return `'${value}'`; // Not valid JSON, treat as string
|
|
711
|
+
}
|
|
712
|
+
case 'Date':
|
|
713
|
+
case 'DATE':
|
|
714
|
+
case 'TIME':
|
|
715
|
+
case 'DATETIME':
|
|
716
|
+
// For date types, wrap in quotes to preserve as string
|
|
717
|
+
if (
|
|
718
|
+
(value.startsWith('"') && value.endsWith('"')) ||
|
|
719
|
+
(value.startsWith("'") && value.endsWith("'"))
|
|
720
|
+
) {
|
|
721
|
+
return value; // Already quoted
|
|
722
|
+
}
|
|
723
|
+
return `'${value}'`;
|
|
724
|
+
case 'Map':
|
|
725
|
+
case 'Set':
|
|
726
|
+
// For Map and Set types, try to parse as JSON or wrap in quotes if it's a string
|
|
727
|
+
try {
|
|
728
|
+
JSON.parse(value);
|
|
729
|
+
return value; // Valid JSON
|
|
730
|
+
} catch {
|
|
731
|
+
return `'${value}'`; // Not valid JSON, treat as string
|
|
732
|
+
}
|
|
733
|
+
default:
|
|
734
|
+
// For other types, default to string behavior
|
|
735
|
+
if (
|
|
736
|
+
(value.startsWith('"') && value.endsWith('"')) ||
|
|
737
|
+
(value.startsWith("'") && value.endsWith("'"))
|
|
738
|
+
) {
|
|
739
|
+
return value; // Already quoted
|
|
740
|
+
}
|
|
741
|
+
return `'${value}'`;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
return arg.name;
|
|
745
|
+
},
|
|
746
|
+
);
|
|
747
|
+
|
|
748
|
+
// Format the function call
|
|
749
|
+
const functionCall = `${functionName}(${argValues.join(', ')})`;
|
|
750
|
+
|
|
751
|
+
// Return formatted code
|
|
752
|
+
return returnValueName
|
|
753
|
+
? `const ${returnValueName} = ${functionCall};`
|
|
754
|
+
: `${functionCall};`;
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
function parseFunction(node: MiddleSchema): string {
|
|
758
|
+
console.log('Parsing function node:', {
|
|
759
|
+
name: node.name,
|
|
760
|
+
hasCustomCode: !!node.customCode,
|
|
761
|
+
customCodeLength: node.customCode?.length,
|
|
762
|
+
customCode: node.customCode,
|
|
763
|
+
});
|
|
764
|
+
|
|
765
|
+
const params = node.parameters
|
|
766
|
+
?.map((param) => {
|
|
767
|
+
if (typeof param === 'string') {
|
|
768
|
+
return param;
|
|
769
|
+
} else if (
|
|
770
|
+
typeof param === 'object' &&
|
|
771
|
+
'name' in param &&
|
|
772
|
+
'type' in param
|
|
773
|
+
) {
|
|
774
|
+
const { name, type } = param as FunctionParameter;
|
|
775
|
+
return `${name}: ${type}`;
|
|
776
|
+
}
|
|
777
|
+
return '';
|
|
778
|
+
})
|
|
779
|
+
.join(', ');
|
|
780
|
+
|
|
781
|
+
if (node.customCode) {
|
|
782
|
+
console.log('Using custom code for function:', node.name);
|
|
783
|
+
// Wrap the custom code in the function declaration
|
|
784
|
+
return `function ${node.name}(${params}) {\n ${node.customCode}\n}`;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
console.log('Generating function from body for:', node.name);
|
|
788
|
+
const body =
|
|
789
|
+
node.body
|
|
790
|
+
?.filter((n): n is MiddleSchema => n !== undefined)
|
|
791
|
+
.map(parseNode)
|
|
792
|
+
.join('\n ') || '';
|
|
793
|
+
return `function ${node.name}(${params}) {\n ${body}\n}`;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
// Helper function to parse RuleGroup to JavaScript expression
|
|
797
|
+
function parseRuleGroup(ruleGroup: RuleGroup): string {
|
|
798
|
+
if (ruleGroup.rules.length === 0) return 'true';
|
|
799
|
+
|
|
800
|
+
const ruleExpressions = ruleGroup.rules.map((rule) => {
|
|
801
|
+
if ('combinator' in rule) {
|
|
802
|
+
// Nested RuleGroup
|
|
803
|
+
return `(${parseRuleGroup(rule)})`;
|
|
804
|
+
} else {
|
|
805
|
+
// Single Rule
|
|
806
|
+
return parseRule(rule);
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
|
|
810
|
+
const operator = ruleGroup.combinator === 'and' ? '&&' : '||';
|
|
811
|
+
return ruleExpressions.join(` ${operator} `);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// Helper function to parse a single Rule to JavaScript expression
|
|
815
|
+
function parseRule(rule: any): string {
|
|
816
|
+
// Debug logging
|
|
817
|
+
console.log('Parsing rule:', rule);
|
|
818
|
+
|
|
819
|
+
// Handle field
|
|
820
|
+
let field: string;
|
|
821
|
+
if (rule.field?.rawValue) {
|
|
822
|
+
// Plain text input
|
|
823
|
+
field = rule.field.rawValue;
|
|
824
|
+
} else if (rule.field?.label && rule.field?.type) {
|
|
825
|
+
// Structured input with type and label
|
|
826
|
+
field = `{{${rule.field.type}.${rule.field.label}}}`;
|
|
827
|
+
} else {
|
|
828
|
+
// Fallback
|
|
829
|
+
field = rule.field?.label || '';
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
// Handle value
|
|
833
|
+
let value: string;
|
|
834
|
+
if (rule.value?.rawValue) {
|
|
835
|
+
// Plain text input
|
|
836
|
+
value = rule.value.rawValue;
|
|
837
|
+
} else if (rule.value?.label && rule.value?.type) {
|
|
838
|
+
// Structured input with type and label
|
|
839
|
+
value = `{{${rule.value.type}.${rule.value.label}}}`;
|
|
840
|
+
} else {
|
|
841
|
+
// Fallback
|
|
842
|
+
value = rule.value?.label || '';
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
console.log('Parsed field:', field, 'value:', value);
|
|
846
|
+
|
|
847
|
+
switch (rule.operator) {
|
|
848
|
+
case '=':
|
|
849
|
+
return `${field} === ${value}`;
|
|
850
|
+
case '!=':
|
|
851
|
+
return `${field} !== ${value}`;
|
|
852
|
+
case '>':
|
|
853
|
+
return `${field} > ${value}`;
|
|
854
|
+
case '<':
|
|
855
|
+
return `${field} < ${value}`;
|
|
856
|
+
case '>=':
|
|
857
|
+
return `${field} >= ${value}`;
|
|
858
|
+
case '<=':
|
|
859
|
+
return `${field} <= ${value}`;
|
|
860
|
+
default:
|
|
861
|
+
return `${field} === ${value}`;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
function parseBranch(node: MiddleSchema): string {
|
|
866
|
+
let condition: string;
|
|
867
|
+
|
|
868
|
+
// Check if we have multiple conditions (RuleGroup) or single condition
|
|
869
|
+
if (node.conditions && node.conditions.rules.length > 0) {
|
|
870
|
+
condition = parseRuleGroup(node.conditions);
|
|
871
|
+
} else {
|
|
872
|
+
condition = parseExpression(node.condition || '');
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
const trueBranch =
|
|
876
|
+
node.true
|
|
877
|
+
?.filter((n): n is MiddleSchema => n !== undefined)
|
|
878
|
+
.map(parseNode)
|
|
879
|
+
.join('\n ') || '';
|
|
880
|
+
const falseBranch = node.false
|
|
881
|
+
? node.false
|
|
882
|
+
.filter((n): n is MiddleSchema => n !== undefined)
|
|
883
|
+
.map(parseNode)
|
|
884
|
+
.join('\n ')
|
|
885
|
+
: '';
|
|
886
|
+
|
|
887
|
+
return `if (${condition}) {\n ${trueBranch}\n}${falseBranch ? ` else {\n ${falseBranch}\n}` : ''}`;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
function parseLet(node: MiddleSchema): string {
|
|
891
|
+
// Handle different modes
|
|
892
|
+
if (node.mode === 'code' && node.customCode) {
|
|
893
|
+
return node.customCode;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
if (node.mode === 'object' && node.objectDefinition) {
|
|
897
|
+
return parseObjectDefinition(node.objectDefinition);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// Default to simple bindings mode
|
|
901
|
+
const bindings = node.bindings
|
|
902
|
+
?.map(
|
|
903
|
+
([name, value]) => `let ${name} = ${parseExpression(value || '')};`,
|
|
904
|
+
)
|
|
905
|
+
.join('\n');
|
|
906
|
+
return bindings || '';
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
// Helper function to parse object definition
|
|
910
|
+
function parseObjectDefinition(objectDef: any): string {
|
|
911
|
+
if (
|
|
912
|
+
!objectDef.variableName ||
|
|
913
|
+
!objectDef.properties ||
|
|
914
|
+
objectDef.properties.length === 0
|
|
915
|
+
) {
|
|
916
|
+
return '';
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
const properties = objectDef.properties
|
|
920
|
+
.map((prop: any) => {
|
|
921
|
+
const key = prop.key;
|
|
922
|
+
const value = parseExpression(prop.value || '');
|
|
923
|
+
return ` ${key}: ${value}`;
|
|
924
|
+
})
|
|
925
|
+
.join(',\n');
|
|
926
|
+
|
|
927
|
+
return `let ${objectDef.variableName} = {\n${properties}\n};`;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
function parseLoop(node: MiddleSchema): string {
|
|
931
|
+
let condition: string;
|
|
932
|
+
|
|
933
|
+
// Check if we have multiple conditions (RuleGroup) or single condition
|
|
934
|
+
if (node.conditions && node.conditions.rules.length > 0) {
|
|
935
|
+
condition = parseRuleGroup(node.conditions);
|
|
936
|
+
} else {
|
|
937
|
+
condition = parseExpression(node.condition || '');
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
const body =
|
|
941
|
+
node.body
|
|
942
|
+
?.filter((n): n is MiddleSchema => n !== undefined)
|
|
943
|
+
.map(parseNode)
|
|
944
|
+
.join('\n ') || '';
|
|
945
|
+
|
|
946
|
+
return `while (${condition}) {\n ${body}\n}`;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
function parseExpression(expr: Expression): string {
|
|
950
|
+
if (typeof expr === 'number') {
|
|
951
|
+
return expr.toString();
|
|
952
|
+
} else if (typeof expr === 'string' && !isNaN(Number(expr))) {
|
|
953
|
+
return expr;
|
|
954
|
+
} else if (typeof expr === 'string') {
|
|
955
|
+
return /^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(expr)
|
|
956
|
+
? expr
|
|
957
|
+
: JSON.stringify(expr);
|
|
958
|
+
} else if (typeof expr === 'object' && expr.operation) {
|
|
959
|
+
const [left, right] = expr.operands.map(parseExpression);
|
|
960
|
+
|
|
961
|
+
// Handle special operators that need different formatting
|
|
962
|
+
switch (expr.operation) {
|
|
963
|
+
case '=':
|
|
964
|
+
// Assignment operator - no parentheses needed
|
|
965
|
+
return `${left} = ${right}`;
|
|
966
|
+
case '==':
|
|
967
|
+
case '!=':
|
|
968
|
+
// Equality operators - use parentheses for clarity
|
|
969
|
+
return `(${left} ${expr.operation} ${right})`;
|
|
970
|
+
default:
|
|
971
|
+
// All other operators - use parentheses
|
|
972
|
+
return `(${left} ${expr.operation} ${right})`;
|
|
973
|
+
}
|
|
974
|
+
} else {
|
|
975
|
+
return JSON.stringify(expr);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
// --- New helper for forLoop ---
|
|
980
|
+
function parseForLoop(node: MiddleSchema): string {
|
|
981
|
+
// Format initialization with 'let' keyword
|
|
982
|
+
let init = node.init || '';
|
|
983
|
+
if (
|
|
984
|
+
init &&
|
|
985
|
+
!init.startsWith('let ') &&
|
|
986
|
+
!init.startsWith('const ') &&
|
|
987
|
+
!init.startsWith('var ')
|
|
988
|
+
) {
|
|
989
|
+
// Check if it's an assignment expression (contains '=')
|
|
990
|
+
if (init.includes('=')) {
|
|
991
|
+
init = `let ${init}`;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
// Parse expressions with proper data type handling
|
|
996
|
+
let condition: string;
|
|
997
|
+
|
|
998
|
+
// Check if we have multiple conditions (RuleGroup) or single condition
|
|
999
|
+
if (node.conditions && node.conditions.rules.length > 0) {
|
|
1000
|
+
condition = parseRuleGroup(node.conditions);
|
|
1001
|
+
} else {
|
|
1002
|
+
condition = parseExpression(node.condition || '');
|
|
1003
|
+
}
|
|
1004
|
+
const update = parseExpression(node.update || '');
|
|
1005
|
+
|
|
1006
|
+
const body =
|
|
1007
|
+
node.body
|
|
1008
|
+
?.filter(Boolean)
|
|
1009
|
+
.map((n) => parseNode(n as MiddleSchema))
|
|
1010
|
+
.join('\n ') || '';
|
|
1011
|
+
|
|
1012
|
+
return `for (${init}; ${condition}; ${update}) {\n ${body}\n}`;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// --- New helper for try/catch ---
|
|
1016
|
+
function parseTry(node: MiddleSchema): string {
|
|
1017
|
+
const body =
|
|
1018
|
+
node.body
|
|
1019
|
+
?.filter(Boolean)
|
|
1020
|
+
.map((n) => parseNode(n as MiddleSchema))
|
|
1021
|
+
.join('\n ') || '';
|
|
1022
|
+
let catchBlock = '';
|
|
1023
|
+
if (node.catchBlock) {
|
|
1024
|
+
catchBlock = parseCatch(node.catchBlock);
|
|
1025
|
+
} else {
|
|
1026
|
+
console.log('No catch block found in try node:', node);
|
|
1027
|
+
}
|
|
1028
|
+
return `try {\n ${body}\n}${catchBlock}`;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
function parseCatch(node: MiddleSchema): string {
|
|
1032
|
+
const errorVar = node.errorVar || 'e';
|
|
1033
|
+
const body =
|
|
1034
|
+
node.body
|
|
1035
|
+
?.filter(Boolean)
|
|
1036
|
+
.map((n) => parseNode(n as MiddleSchema))
|
|
1037
|
+
.join('\n ') || '';
|
|
1038
|
+
return ` catch (${errorVar}) {\n ${body}\n}`;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
function parseReturn(node: MiddleSchema): string {
|
|
1042
|
+
const value = parseExpression(node.value || '');
|
|
1043
|
+
return `return ${value};`;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
function parseSet(node: MiddleSchema): string {
|
|
1047
|
+
const variable = node.variable;
|
|
1048
|
+
const value = parseExpression(node.value || '');
|
|
1049
|
+
return `${variable} = ${value};`;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
// --- New helper for switch/case ---
|
|
1053
|
+
function parseSwitch(node: MiddleSchema): string {
|
|
1054
|
+
const switchValue = node.switchValue || '';
|
|
1055
|
+
const cases =
|
|
1056
|
+
node.body
|
|
1057
|
+
?.filter(Boolean)
|
|
1058
|
+
.map((n) => parseCaseNode(n as MiddleSchema))
|
|
1059
|
+
.join('\n ') || '';
|
|
1060
|
+
return `switch (${switchValue}) {\n ${cases}\n}`;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
function parseCaseNode(node: MiddleSchema): string {
|
|
1064
|
+
// Handle default case
|
|
1065
|
+
if (node.title === 'Default') {
|
|
1066
|
+
// For case nodes, we need to process their body if they have one
|
|
1067
|
+
const body =
|
|
1068
|
+
node.body
|
|
1069
|
+
?.filter(Boolean)
|
|
1070
|
+
.map((n) => parseNode(n as MiddleSchema))
|
|
1071
|
+
.join('\n ') || '';
|
|
1072
|
+
return `default:\n ${body}\n break;`;
|
|
1073
|
+
} else {
|
|
1074
|
+
// For case nodes, we need to process their body if they have one
|
|
1075
|
+
// Use the title as the case value, or fallback to a generic case
|
|
1076
|
+
const caseValue = node.title || 'value';
|
|
1077
|
+
const body =
|
|
1078
|
+
node.body
|
|
1079
|
+
?.filter(Boolean)
|
|
1080
|
+
.map((n) => parseNode(n as MiddleSchema))
|
|
1081
|
+
.join('\n ') || '';
|
|
1082
|
+
return `case '${caseValue}':\n ${body}\n break;`;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
function parseApi(node: MiddleSchema): string {
|
|
1087
|
+
// Extract API node properties
|
|
1088
|
+
const method = (node as any).method || 'GET';
|
|
1089
|
+
const url = (node as any).url || '';
|
|
1090
|
+
const headers = (node as any).headers || [];
|
|
1091
|
+
const queryParams = (node as any).queryParams || [];
|
|
1092
|
+
const body = (node as any).requestBody || '';
|
|
1093
|
+
const bodyType = (node as any).bodyType || 'json';
|
|
1094
|
+
const responseVariable = (node as any).responseVariable || 'apiResponse';
|
|
1095
|
+
const responseDataType = (node as any).responseDataType || 'Object';
|
|
1096
|
+
|
|
1097
|
+
// Generate headers object
|
|
1098
|
+
const headersObj = headers
|
|
1099
|
+
.filter((h: any) => h.key && h.value)
|
|
1100
|
+
.reduce(
|
|
1101
|
+
(acc: any, h: any) => {
|
|
1102
|
+
acc[h.key] = h.value;
|
|
1103
|
+
return acc;
|
|
1104
|
+
},
|
|
1105
|
+
{} as Record<string, string>,
|
|
1106
|
+
);
|
|
1107
|
+
|
|
1108
|
+
// Generate query parameters
|
|
1109
|
+
const queryString = queryParams
|
|
1110
|
+
.filter((q: any) => q.key && q.value)
|
|
1111
|
+
.map(
|
|
1112
|
+
(q: any) =>
|
|
1113
|
+
`${encodeURIComponent(q.key)}=${encodeURIComponent(q.value)}`,
|
|
1114
|
+
)
|
|
1115
|
+
.join('&');
|
|
1116
|
+
|
|
1117
|
+
const fullUrl = queryString ? `${url}?${queryString}` : url;
|
|
1118
|
+
|
|
1119
|
+
// Build the fetch options object manually for proper formatting
|
|
1120
|
+
let fetchOptions = `{
|
|
1121
|
+
method: "${method.toUpperCase()}"`;
|
|
1122
|
+
|
|
1123
|
+
// Add headers
|
|
1124
|
+
if (Object.keys(headersObj).length > 0) {
|
|
1125
|
+
fetchOptions += `,
|
|
1126
|
+
headers: {
|
|
1127
|
+
${Object.entries(headersObj)
|
|
1128
|
+
.map(([key, value]) => `"${key}": "${value}"`)
|
|
1129
|
+
.join(',\n ')}
|
|
1130
|
+
}`;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
// Add body for POST, PUT, PATCH
|
|
1134
|
+
if (['POST', 'PUT', 'PATCH'].includes(method.toUpperCase()) && body) {
|
|
1135
|
+
switch (bodyType) {
|
|
1136
|
+
case 'json':
|
|
1137
|
+
try {
|
|
1138
|
+
// Parse the JSON string to validate it, then stringify it properly
|
|
1139
|
+
const parsedBody = JSON.parse(body);
|
|
1140
|
+
fetchOptions += `,
|
|
1141
|
+
body: JSON.stringify(${JSON.stringify(parsedBody)})`;
|
|
1142
|
+
} catch {
|
|
1143
|
+
// If parsing fails, treat as raw string and stringify it
|
|
1144
|
+
fetchOptions += `,
|
|
1145
|
+
body: JSON.stringify("${body}")`;
|
|
1146
|
+
}
|
|
1147
|
+
break;
|
|
1148
|
+
case 'form-data':
|
|
1149
|
+
fetchOptions += `,
|
|
1150
|
+
body: new FormData().append('data', '${body}')`;
|
|
1151
|
+
break;
|
|
1152
|
+
case 'x-www-form-urlencoded':
|
|
1153
|
+
try {
|
|
1154
|
+
const parsedBody = JSON.parse(body);
|
|
1155
|
+
const formData = new URLSearchParams(parsedBody).toString();
|
|
1156
|
+
fetchOptions += `,
|
|
1157
|
+
body: "${formData}"`;
|
|
1158
|
+
} catch {
|
|
1159
|
+
const formData = new URLSearchParams(body).toString();
|
|
1160
|
+
fetchOptions += `,
|
|
1161
|
+
body: "${formData}"`;
|
|
1162
|
+
}
|
|
1163
|
+
break;
|
|
1164
|
+
case 'raw':
|
|
1165
|
+
fetchOptions += `,
|
|
1166
|
+
body: "${body}"`;
|
|
1167
|
+
break;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
fetchOptions += '\n }';
|
|
1172
|
+
|
|
1173
|
+
// Generate the complete API call code
|
|
1174
|
+
const apiCall = `const response = await fetch('${fullUrl}', ${fetchOptions});
|
|
1175
|
+
|
|
1176
|
+
if (!response.ok) {
|
|
1177
|
+
throw new Error(\`HTTP \${response.status}: \${response.statusText}\`);
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
const ${responseVariable} = await response.${responseDataType === 'String' ? 'text()' : 'json()'};`;
|
|
1181
|
+
|
|
1182
|
+
return apiCall;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
function parseCustomGraphQLQuery(
|
|
1186
|
+
node: MiddleSchema,
|
|
1187
|
+
customQuery: string,
|
|
1188
|
+
url: string,
|
|
1189
|
+
headers: any[],
|
|
1190
|
+
responseVariable: string,
|
|
1191
|
+
responseDataType: string,
|
|
1192
|
+
): string {
|
|
1193
|
+
// Generate headers object
|
|
1194
|
+
const headersObj = headers
|
|
1195
|
+
.filter((h: any) => h.key && h.value)
|
|
1196
|
+
.reduce(
|
|
1197
|
+
(acc: any, h: any) => {
|
|
1198
|
+
acc[h.key] = h.value;
|
|
1199
|
+
return acc;
|
|
1200
|
+
},
|
|
1201
|
+
{} as Record<string, string>,
|
|
1202
|
+
);
|
|
1203
|
+
|
|
1204
|
+
// Build the fetch options object
|
|
1205
|
+
let fetchOptions = `{
|
|
1206
|
+
method: "POST"`;
|
|
1207
|
+
|
|
1208
|
+
// Add headers
|
|
1209
|
+
if (Object.keys(headersObj).length > 0) {
|
|
1210
|
+
fetchOptions += `,
|
|
1211
|
+
headers: {
|
|
1212
|
+
${Object.entries(headersObj)
|
|
1213
|
+
.map(([key, value]) => `"${key}": "${value}"`)
|
|
1214
|
+
.join(',\n ')}
|
|
1215
|
+
}`;
|
|
1216
|
+
} else {
|
|
1217
|
+
// Default Content-Type for GraphQL
|
|
1218
|
+
fetchOptions += `,
|
|
1219
|
+
headers: {
|
|
1220
|
+
"Content-Type": "application/json"
|
|
1221
|
+
}`;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
// Add body with custom GraphQL query
|
|
1225
|
+
fetchOptions += `,
|
|
1226
|
+
body: JSON.stringify({
|
|
1227
|
+
query: \`${customQuery}\`,
|
|
1228
|
+
variables: {}
|
|
1229
|
+
})`;
|
|
1230
|
+
|
|
1231
|
+
fetchOptions += '\n }';
|
|
1232
|
+
|
|
1233
|
+
// Generate unique variable names to avoid conflicts
|
|
1234
|
+
const responseVarName = `response${Math.random().toString(36).substr(2, 9)}`;
|
|
1235
|
+
const dataVarName = `data${Math.random().toString(36).substr(2, 9)}`;
|
|
1236
|
+
|
|
1237
|
+
// Generate the complete GraphQL call code
|
|
1238
|
+
const responseMethod =
|
|
1239
|
+
responseDataType === 'String' ? 'text()' : 'json()';
|
|
1240
|
+
const responseAssignment =
|
|
1241
|
+
responseDataType === 'String'
|
|
1242
|
+
? `const ${responseVariable} = await ${responseVarName}.${responseMethod};`
|
|
1243
|
+
: `const { data: ${dataVarName} } = await ${responseVarName}.${responseMethod};
|
|
1244
|
+
const ${responseVariable} = ${dataVarName};`;
|
|
1245
|
+
|
|
1246
|
+
const graphqlCall = `const ${responseVarName} = await fetch('${url}', ${fetchOptions});
|
|
1247
|
+
|
|
1248
|
+
if (!${responseVarName}.ok) {
|
|
1249
|
+
throw new Error(\`HTTP \${${responseVarName}.status}: \${${responseVarName}.statusText}\`);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
${responseAssignment}`;
|
|
1253
|
+
|
|
1254
|
+
return graphqlCall;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
function parseGraphQL(node: MiddleSchema): string {
|
|
1258
|
+
// Extract GraphQL node properties
|
|
1259
|
+
const mode = (node as any).graphqlMode || 'normal';
|
|
1260
|
+
const operationType = (node as any).operationType || 'query';
|
|
1261
|
+
const operationName = (node as any).operationName || '';
|
|
1262
|
+
const rootField = (node as any).rootField || 'field';
|
|
1263
|
+
const url = (node as any).url || '';
|
|
1264
|
+
const headers = (node as any).headers || [];
|
|
1265
|
+
const nodeArguments = (node as any).arguments || [];
|
|
1266
|
+
const fields = (node as any).fields || [];
|
|
1267
|
+
const variables = (node as any).variables || [];
|
|
1268
|
+
const responseVariable =
|
|
1269
|
+
(node as any).responseVariable || 'graphqlResponse';
|
|
1270
|
+
const responseDataType = (node as any).responseDataType || 'Object';
|
|
1271
|
+
const customQuery = (node as any).customQuery || '';
|
|
1272
|
+
|
|
1273
|
+
// If in advanced mode and custom query is provided, use it directly
|
|
1274
|
+
if (mode === 'advanced' && customQuery.trim()) {
|
|
1275
|
+
return parseCustomGraphQLQuery(
|
|
1276
|
+
node,
|
|
1277
|
+
customQuery,
|
|
1278
|
+
url,
|
|
1279
|
+
headers,
|
|
1280
|
+
responseVariable,
|
|
1281
|
+
responseDataType,
|
|
1282
|
+
);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
// Generate headers object
|
|
1286
|
+
const headersObj = headers
|
|
1287
|
+
.filter((h: any) => h.key && h.value)
|
|
1288
|
+
.reduce(
|
|
1289
|
+
(acc: any, h: any) => {
|
|
1290
|
+
acc[h.key] = h.value;
|
|
1291
|
+
return acc;
|
|
1292
|
+
},
|
|
1293
|
+
{} as Record<string, string>,
|
|
1294
|
+
);
|
|
1295
|
+
|
|
1296
|
+
// Generate variables object and variable declarations
|
|
1297
|
+
const variablesObj = variables
|
|
1298
|
+
.filter((v: any) => v.key && v.value)
|
|
1299
|
+
.reduce(
|
|
1300
|
+
(acc: any, v: any) => {
|
|
1301
|
+
// Use variable name without $ prefix for the variables object
|
|
1302
|
+
const varName = v.key.startsWith('$') ? v.key.slice(1) : v.key;
|
|
1303
|
+
// Convert values to proper types based on GraphQL type
|
|
1304
|
+
let value = v.value;
|
|
1305
|
+
if (v.type === 'Int' || v.type === 'Float') {
|
|
1306
|
+
value = parseFloat(v.value);
|
|
1307
|
+
} else if (v.type === 'Boolean') {
|
|
1308
|
+
value = v.value === 'true';
|
|
1309
|
+
} else if (v.type === 'ID' && !isNaN(Number(v.value))) {
|
|
1310
|
+
value = v.value; // Keep as string for ID
|
|
1311
|
+
}
|
|
1312
|
+
acc[varName] = value;
|
|
1313
|
+
return acc;
|
|
1314
|
+
},
|
|
1315
|
+
{} as Record<string, any>,
|
|
1316
|
+
);
|
|
1317
|
+
|
|
1318
|
+
// Generate variable declarations for the query
|
|
1319
|
+
const variableDeclarations = variables
|
|
1320
|
+
.filter((v: any) => v.key && v.type)
|
|
1321
|
+
.map((v: any) => {
|
|
1322
|
+
const varName = v.key.startsWith('$') ? v.key : `$${v.key}`;
|
|
1323
|
+
return `${varName}: ${v.type}`;
|
|
1324
|
+
})
|
|
1325
|
+
.join(', ');
|
|
1326
|
+
const variablesString = variableDeclarations
|
|
1327
|
+
? `(${variableDeclarations})`
|
|
1328
|
+
: '';
|
|
1329
|
+
|
|
1330
|
+
// Generate arguments string - use variables if they exist, otherwise use direct values
|
|
1331
|
+
const args = nodeArguments
|
|
1332
|
+
.filter((arg: any) => arg.key && arg.value)
|
|
1333
|
+
.map((arg: any) => {
|
|
1334
|
+
// Check if the value is already a variable reference (starts with $)
|
|
1335
|
+
if (arg.value.startsWith('$')) {
|
|
1336
|
+
return `${arg.key}: ${arg.value}`;
|
|
1337
|
+
}
|
|
1338
|
+
// Check if there's a variable with the same key
|
|
1339
|
+
const matchingVariable = variables.find(
|
|
1340
|
+
(v: any) => v.key === arg.key,
|
|
1341
|
+
);
|
|
1342
|
+
if (matchingVariable) {
|
|
1343
|
+
const varName = matchingVariable.key.startsWith('$')
|
|
1344
|
+
? matchingVariable.key
|
|
1345
|
+
: `$${matchingVariable.key}`;
|
|
1346
|
+
return `${arg.key}: ${varName}`;
|
|
1347
|
+
}
|
|
1348
|
+
return `${arg.key}: ${arg.value}`;
|
|
1349
|
+
})
|
|
1350
|
+
.join(', ');
|
|
1351
|
+
const argsString = args ? `(${args})` : '';
|
|
1352
|
+
|
|
1353
|
+
// Generate fields string
|
|
1354
|
+
const fieldsList = fields
|
|
1355
|
+
.filter((field: any) => field.name)
|
|
1356
|
+
.map((field: any) => field.name)
|
|
1357
|
+
.join('\n ');
|
|
1358
|
+
const fieldsString = fieldsList ? ` {\n ${fieldsList}\n }` : '';
|
|
1359
|
+
|
|
1360
|
+
// Build the GraphQL query
|
|
1361
|
+
const operationNameStr = operationName ? ` ${operationName}` : '';
|
|
1362
|
+
const query = `${operationType}${operationNameStr}${variablesString} {\n ${rootField}${argsString}${fieldsString}\n}`;
|
|
1363
|
+
|
|
1364
|
+
// Build the fetch options object
|
|
1365
|
+
let fetchOptions = `{
|
|
1366
|
+
method: "POST"`;
|
|
1367
|
+
|
|
1368
|
+
// Add headers
|
|
1369
|
+
if (Object.keys(headersObj).length > 0) {
|
|
1370
|
+
fetchOptions += `,
|
|
1371
|
+
headers: {
|
|
1372
|
+
${Object.entries(headersObj)
|
|
1373
|
+
.map(([key, value]) => `"${key}": "${value}"`)
|
|
1374
|
+
.join(',\n ')}
|
|
1375
|
+
}`;
|
|
1376
|
+
} else {
|
|
1377
|
+
// Default Content-Type for GraphQL
|
|
1378
|
+
fetchOptions += `,
|
|
1379
|
+
headers: {
|
|
1380
|
+
"Content-Type": "application/json"
|
|
1381
|
+
}`;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
// Add body with GraphQL query and variables
|
|
1385
|
+
fetchOptions += `,
|
|
1386
|
+
body: JSON.stringify({
|
|
1387
|
+
query: \`${query}\`,
|
|
1388
|
+
variables: ${JSON.stringify(variablesObj)}
|
|
1389
|
+
})`;
|
|
1390
|
+
|
|
1391
|
+
fetchOptions += '\n }';
|
|
1392
|
+
|
|
1393
|
+
// Generate unique variable names to avoid conflicts
|
|
1394
|
+
const responseVarName = `response${Math.random().toString(36).substr(2, 9)}`;
|
|
1395
|
+
const dataVarName = `data${Math.random().toString(36).substr(2, 9)}`;
|
|
1396
|
+
|
|
1397
|
+
// Generate the complete GraphQL call code
|
|
1398
|
+
const responseMethod =
|
|
1399
|
+
responseDataType === 'String' ? 'text()' : 'json()';
|
|
1400
|
+
const responseAssignment =
|
|
1401
|
+
responseDataType === 'String'
|
|
1402
|
+
? `const ${responseVariable} = await ${responseVarName}.${responseMethod};`
|
|
1403
|
+
: `const { data: ${dataVarName} } = await ${responseVarName}.${responseMethod};
|
|
1404
|
+
const ${responseVariable} = ${dataVarName};`;
|
|
1405
|
+
|
|
1406
|
+
const graphqlCall = `const ${responseVarName} = await fetch('${url}', ${fetchOptions});
|
|
1407
|
+
|
|
1408
|
+
if (!${responseVarName}.ok) {
|
|
1409
|
+
throw new Error(\`HTTP \${${responseVarName}.status}: \${${responseVarName}.statusText}\`);
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
${responseAssignment}`;
|
|
1413
|
+
|
|
1414
|
+
return graphqlCall;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
return parseNode(json);
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
// Only process root nodes (nodes with no parentId) at the top level
|
|
1421
|
+
const rootNodes = clonedJson.nodes.filter((node) => !node.parentId);
|
|
1422
|
+
const output = rootNodes
|
|
1423
|
+
.map((node) => processNode(node, new Set<string>()))
|
|
1424
|
+
.filter(Boolean) as MiddleSchema[];
|
|
1425
|
+
|
|
1426
|
+
// Find all function nodes instead of just one
|
|
1427
|
+
const allFunctions = output.filter((n) => n.type === 'function');
|
|
1428
|
+
|
|
1429
|
+
if (allFunctions.length > 0) {
|
|
1430
|
+
// Generate code for each function separately
|
|
1431
|
+
const functionCodes = allFunctions.map((func) => {
|
|
1432
|
+
// Reset processedNodes for each function to avoid conflicts
|
|
1433
|
+
processedNodes.clear();
|
|
1434
|
+
|
|
1435
|
+
// Find the original function node to get its ID
|
|
1436
|
+
const originalFunctionNode = rootNodes.find(
|
|
1437
|
+
(node) => node.id === func.id,
|
|
1438
|
+
);
|
|
1439
|
+
if (!originalFunctionNode) return jsonToJavaScript(func as MiddleSchema);
|
|
1440
|
+
|
|
1441
|
+
// Find nodes that belong to this specific function by following edges
|
|
1442
|
+
// and exclude nodes that belong to other functions
|
|
1443
|
+
const functionBody = findNodesBelongingToFunction(
|
|
1444
|
+
originalFunctionNode,
|
|
1445
|
+
rootNodes,
|
|
1446
|
+
clonedJson.edges,
|
|
1447
|
+
allFunctions
|
|
1448
|
+
.map((f) => f.id)
|
|
1449
|
+
.filter((id): id is string => id !== undefined), // Filter out undefined and type guard
|
|
1450
|
+
);
|
|
1451
|
+
|
|
1452
|
+
func.body = functionBody;
|
|
1453
|
+
return jsonToJavaScript(func as MiddleSchema);
|
|
1454
|
+
});
|
|
1455
|
+
|
|
1456
|
+
const mainCode = functionCodes.join('\n\n');
|
|
1457
|
+
|
|
1458
|
+
return {
|
|
1459
|
+
externalFunctions: externalFunctions.join('\n'),
|
|
1460
|
+
mainCode: mainCode,
|
|
1461
|
+
};
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
return { externalFunctions: '', mainCode: '' };
|
|
1465
|
+
};
|