## Description Contains the changes to remove fast-xml-parserV3.17.5 as a default library and migrate all existing apps to install it as a custom JS library on page load. Installations no longer fail when there is a naming collision, we determine a unique accessor that can work inside the application both for UMD & ESM builds. #### PR fixes following issue(s) Fixes https://github.com/appsmithorg/appsmith-ee/issues/2562 Fixes https://github.com/appsmithorg/appsmith-ee/issues/2563 Fixes https://github.com/appsmithorg/appsmith-ee/issues/2073 Fixes https://github.com/appsmithorg/appsmith-ee/issues/2403 #### Type of change - Chore (housekeeping or task changes that don't impact user perception) > ## Testing > #### How Has This Been Tested? - [x] Manual - [x] JUnit - [x] Jest - [x] Cypress > > #### Test Plan https://github.com/appsmithorg/TestSmith/issues/2536 Scenarios for existing apps will be tested post-merge since DP's are created with fresh DB that don't have release data > > #### Issues raised during DP testing https://github.com/appsmithorg/appsmith/pull/28012#issuecomment-1767711382 response: https://github.com/appsmithorg/appsmith/pull/28012#issuecomment-1767781029 > > > ## 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: - [x] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [x] 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 - [x] 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 - [x] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed --------- Co-authored-by: manish kumar <manish@appsmith.com> Co-authored-by: Manish Kumar <107841575+sondermanish@users.noreply.github.com>
34 lines
993 B
TypeScript
34 lines
993 B
TypeScript
import { APP_MODE } from "entities/App";
|
|
import type { JSLibrary } from "workers/common/JSLibrary";
|
|
import Api from "./Api";
|
|
|
|
export default class LibraryApi extends Api {
|
|
static base_url = "v1/libraries";
|
|
|
|
static getUpdateLibraryBaseURL = (applicationId: string) =>
|
|
`${LibraryApi.base_url}/${applicationId}`;
|
|
|
|
static async addLibrary(
|
|
applicationId: string,
|
|
library: Partial<JSLibrary> & { defs: string },
|
|
) {
|
|
const url = LibraryApi.getUpdateLibraryBaseURL(applicationId) + "/add";
|
|
return Api.patch(url, library);
|
|
}
|
|
|
|
static async removeLibrary(
|
|
applicationId: string,
|
|
library: Partial<JSLibrary>,
|
|
) {
|
|
const url = LibraryApi.getUpdateLibraryBaseURL(applicationId) + "/remove";
|
|
return Api.patch(url, library);
|
|
}
|
|
|
|
static async getLibraries(applicationId: string, mode: APP_MODE) {
|
|
const url = `${LibraryApi.getUpdateLibraryBaseURL(applicationId)}${
|
|
mode === APP_MODE.PUBLISHED ? "/view" : ""
|
|
}`;
|
|
return Api.get(url);
|
|
}
|
|
}
|