## Description
When create datasource is initiated from the API editor by clicking
"Save as datasource", it fixes the redirection back to the API editor
when `Save` is clicked for modules in package editor.
This PR also refactors the usage of typing of `actionRouteInfo` and
introduces `parentEntityId` instead of using `pageId`, `moduleId`,
`workflowId` separately.
This fix also verifies the sanity of
1. API in apps
2. API in workflows
Fixes https://github.com/appsmithorg/appsmith/issues/31506
## Automation
/ok-to-test tags="@tag.Datasource,@tag.Sanity"
### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results -->
> [!TIP]
> 🟢🟢🟢 All cypress tests have passed! 🎉🎉🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10093685845>
> Commit: 785cbe3a0a42fad2f2ca1d7fb76010eb00505343
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10093685845&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Datasource,@tag.Sanity`
> Spec:
> <hr>Thu, 25 Jul 2024 12:39:50 UTC
<!-- end of auto-generated comment: Cypress test results -->
## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced a new function to retrieve the current module ID, enhancing
state management.
- Added support for handling `parentEntityId` in various data source
sagas.
- **Bug Fixes**
- Improved type safety for action handling in sagas.
- **Tests**
- Added a new test suite for the `handleDatasourceCreatedSaga` to
validate its behavior upon datasource creation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->