Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove version compatibility api usage #323

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/__tests__/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ describe('Auth Commands', () => {
setEnv();
program = await init('fdk');
const mock = new MockAdapter(axios);
mock.onGet(`${URLS.IS_VERSION_COMPATIBLE()}`).reply(200);
await login();
});

Expand Down
1 change: 0 additions & 1 deletion src/__tests__/theme.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ describe('Theme Commands', () => {
const mockInstance = new MockAdapter(
uninterceptedApiClient.axiosInstance,
);
mock.onGet(`${URLS.IS_VERSION_COMPATIBLE()}`).reply(200);
mock.onGet(
`${URLS.GET_APPLICATION_DETAILS(
appConfig.company_id,
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/themeContext.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ describe('Theme Context Commands', () => {
setEnv();
program = await init('fdk');
const mock = new MockAdapter(axios);
mock.onGet(`${URLS.IS_VERSION_COMPATIBLE()}`).reply(200);
mock.onGet(
`${URLS.GET_APPLICATION_DETAILS(
appConfig.company_id,
Expand Down
5 changes: 0 additions & 5 deletions src/lib/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,11 @@ export const startServer = async () => {
return Auth.server;
};

async function checkVersionCompatibility() {
const response = await ThemeService.checkCompatibleVersion();
}

export default class Auth {
static server = null;
static isOrganizationChange = false;
constructor() {}
public static async login() {
await checkVersionCompatibility();
Logger.info(
chalk.green(
'Current env: ',
Expand Down
5 changes: 0 additions & 5 deletions src/lib/CommandError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ export const ErrorCodes = {
`No themes are created, Please create/add a theme under the sales channel. For more details, refer to the documentation link: ${domain}/help/docs/partners/themes/vuejs/overview`,
code: 'FDK-00011',
},
DOWNGRADE_CLI_VERSION: {
message:
'Seems like current Fynd Platform version is not compatible with installed CLI version.\n\nIn order to continue with current FP version, Please use previous version of CLI `npm install -g @gofynd/fdk-cli@3.0.4` command.',
code: 'FDK-00012',
},

// generic
ECONN_RESET: {
Expand Down
9 changes: 0 additions & 9 deletions src/lib/api/helper/interceptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,6 @@ export function responseErrorInterceptor() {
) {
ConfigStore.delete(CONFIG_KEYS.AUTH_TOKEN);
throw new CommandError(COMMON_LOG_MESSAGES.RequireAuth);
} else if (
error.response &&
error.response.status === 404 &&
error.response.config.url.includes('/_compatibility')
) {
throw new CommandError(
ErrorCodes.DOWNGRADE_CLI_VERSION.message,
ErrorCodes.DOWNGRADE_CLI_VERSION.code,
);
} else if (error.response) {
Debug(`Error Response : ${JSON.stringify(error.response.data)}`);
throw new CommandError(
Expand Down
12 changes: 0 additions & 12 deletions src/lib/api/services/theme.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,6 @@ export default {
throw error;
}
},
checkCompatibleVersion: async () => {
try {
let axiosOptions = Object.assign({}, getCommonHeaderOptions());
let response = await ApiClient.get(
URLS.IS_VERSION_COMPATIBLE(),
axiosOptions,
);
return response.data;
} catch (error) {
throw error;
}
},
getDefaultTheme: async (data) => {
try {
const axiosOption = Object.assign({}, getCommonHeaderOptions());
Expand Down
4 changes: 0 additions & 4 deletions src/lib/api/services/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,4 @@ export const URLS = {
`/organization/${organization_id}/accounts/access-request?page_size=${page_size}&page_no=${page_no}&request_status=accepted`,
);
},

IS_VERSION_COMPATIBLE: () => {
return urlJoin(BLITZKRIEG_PANEL_URL(), '/_compatibility');
},
};
Loading