PromucFlow_constructor/app/client/src/api
Nilesh Sarupriya c267965090
chore: refactor curl import API to support context type (#30934)
## Description

Support curl imports for different contexts. 

### Server changes

Previous API: 

`/api/v1/import?type=CURL&pageId={pageId}&name=Api2&workspaceId={workspaceId}`

New API: 
With context type, it will create for the specific context.

`/api/v1/import?type=CURL&contextId={contextId}&name=Api1&workspaceId={workspaceId}&contextType={contextType}`

Without context type, it will create for the page.

`/api/v1/import?type=CURL&contextId={contextId}&name=Api1&workspaceId={workspaceId}`

### Client changes
- Integrate api changes for curl import. Updated request params type and
interfaces for the saga functions
- Updated the form value types for the curl import editor



#### PR fixes following issue(s)
Fixes [[Task]: Curl Import isn't
working.](https://github.com/appsmithorg/appsmith/issues/30933)

#### Media
> N/A

#### Type of change
- Chore (housekeeping or task changes that don't impact user perception)

## Testing
>
#### How Has This Been Tested?
- [x] Manual (using postman)
- [x] JUnit (existing test cases should work)

#### Test Plan
> N/A

#### Issues raised during DP testing
> None

## Checklist:
#### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Enhanced API import functionality with a new context-aware mechanism,
allowing for more flexible integration within different parts of the
application.
- Updated various components and services to support the new contextId
and contextType parameters for improved data handling and redirection
logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Nilesh Sarupriya <20905988+nsarupr@users.noreply.github.com>
Co-authored-by: Ayush Pahwa <ayushpahwa96@gmail.com>
2024-02-14 12:18:30 +05:30
..
ActionAPI.tsx chore: Update Query view for side by side (#30655) 2024-01-31 10:37:40 +05:30
Api.ts chore:add eslint rules (#27878) 2023-10-09 16:54:06 +03:00
ApiResponses.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
AppThemingApi.tsx chore:add eslint rules (#27878) 2023-10-09 16:54:06 +03:00
CloudServicesApi.ts
ConsolidatedPageLoadApi.tsx feat: Frontend changes for consolidated-api with EE test case support (#30506) 2024-01-24 12:14:16 +05:30
DatasourcesApi.ts chore:add eslint rules (#27878) 2023-10-09 16:54:06 +03:00
GitSyncAPI.tsx chore: remove git release feature flags (#30962) 2024-02-09 10:22:47 +05:30
ImportApi.ts chore: refactor curl import API to support context type (#30934) 2024-02-14 12:18:30 +05:30
LibraryAPI.tsx chore: remove xml parser v3 as a default library (#28012) 2023-10-20 11:08:47 +05:30
OAuthApi.ts chore:add eslint rules (#27878) 2023-10-09 16:54:06 +03:00
PageApi.tsx feat: Frontend changes for consolidated-api with EE test case support (#30506) 2024-01-24 12:14:16 +05:30
PluginApi.ts feat: Add knowledge retrieval in Appsmith AI (#30725) 2024-02-05 17:15:45 +05:30
ReleasesAPI.tsx chore:add eslint rules (#27878) 2023-10-09 16:54:06 +03:00
SaasApi.ts chore:add eslint rules (#27878) 2023-10-09 16:54:06 +03:00
SearchApi.tsx feat: Homepage experience v2 changes (#29282) 2024-01-25 19:11:48 +05:30
TemplatesApi.ts chore: template upload process revamping (#29626) 2023-12-15 17:31:25 +05:30
WidgetConfigsApi.tsx chore:add eslint rules (#27878) 2023-10-09 16:54:06 +03:00
WidgetSidebarApi.tsx chore:add eslint rules (#27878) 2023-10-09 16:54:06 +03:00