[CDF-25328] Consider container constraints when uploading instances (#2164)

# Description

This PR adds automatic dependency resolution for data model instances
during upload when InstanceSpaceSelectors are used. The added
functionality analyzes requires container constraints and direct
relations with a required type constraint to determine the necessary
upload order, ensuring referenced entities are created before entities
that reference them.

## Changelog

- [x] Patch
- [ ] Skip

## cdf

### Added

- Added automatic dependency resolution for data model instances based
on container constraints when `data upload`
- Added a new topological sorting method
`topological_sort_container_constraints` to `ViewCRUD` based on
container constraints, in addition to the existing method that considers
`implements`

### Changed

- Renamed `topological_sort` in `ViewCRUD` to
`topological_sort_implements` to distinguish between the new method.

## templates

No changes.

---------

Co-authored-by: Magnus Schjølberg <magnus.schjolberg@cognitedata.com>
Co-authored-by: Anders Albert <60234212+doctrino@users.noreply.github.com>
