How port-experimental/deep-copy-entities works
Key Components to Include:
Source Environment
• A component for Port.io API Authentication using SOURCE credentials
• Entity storage/database representation
Destination Environment
• Similar structure to source, but with DEST credentials
Deep Copy Script Components
• Main Script Controller (main.ts)
• Port Client Handler (port_client.ts)
• Entity Traversal Engine
Component Relationships
• Authentication flow from credentials to respective environments
• Entity reading from source
• Deep traversal of related entities
• Writing to destination
• Recursive relationship handling
Specific Elements
→ Data Flow
⟲ Recursive Operation
🔑 Authentication Point
📦 Entity Container
a. Input Processing:
• Command line arguments (--root-blueprint, --entity-ids)
• Environment variables handling
b. Core Processing:
• Entity traversal logic
• Relationship mapping
• Deep copy mechanics
c. Authentication:
• Dual authentication handling
• Client credential flows
d. Data Flow:
• Entity reading
• Relationship discovery
• Entity replication
• Verification steps
Replicates to destination
A small notes section explaining any important considerations like:
• Handling of circular references
• Error handling flow
• Validation steps
• Rate limiting considerations
This will give other engineers a clear understanding of both the architecture and the operational flow of the entity copying process.