Skip to content

Commit

Permalink
feat: updates deps (& fixes Axios vulnerability), updates eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Aug 15, 2024
1 parent 2d93ea8 commit b6ce5bb
Show file tree
Hide file tree
Showing 9 changed files with 10,439 additions and 10,384 deletions.
16 changes: 0 additions & 16 deletions .eslintrc.cjs

This file was deleted.

23 changes: 23 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked, {
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off'
}
});
2 changes: 1 addition & 1 deletion lib/mappers/base-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export abstract class BaseMapper {
};
}

mapEmptyResponse(response: IResponse<void | any>): BaseResponses.EmptyContentManagementResponse {
mapEmptyResponse(response: IResponse<any>): BaseResponses.EmptyContentManagementResponse {
return new BaseResponses.EmptyContentManagementResponse(this.mapResponseDebug(response), undefined, undefined);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SharedContracts } from '../../contracts';
export namespace LanguageVariantElements {
export interface ILanguageVariantElementBase {
element: SharedContracts.IReferenceObjectContract;
value: any | null;
value: any;
}

export interface IRichTextComponent {
Expand Down
12 changes: 7 additions & 5 deletions lib/queries/base-listing-query.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { IManagementClientConfig } from '../config/imanagement-client-config.interface';
import { IContentManagementListQueryConfig } from '../models';
import { BaseResponses } from '../responses';
Expand All @@ -12,7 +11,10 @@ export abstract class BaseListingQuery<
protected readonly xContinuationHeaderName: string = 'x-continuation';
protected listQueryConfig?: IContentManagementListQueryConfig<TResponse>;

constructor(protected config: IManagementClientConfig, protected queryService: ManagementQueryService) {
constructor(
protected config: IManagementClientConfig,
protected queryService: ManagementQueryService
) {
super(config, queryService);
}

Expand Down Expand Up @@ -40,13 +42,13 @@ export abstract class BaseListingQuery<
/**
* Query to get all items. Uses paging data and may execute multiple HTTP requests depending on number of items
*/
toAllPromise(): Promise<TAllResponse> {
toAllPromise(): Promise<TAllResponse> {
return this.queryService.getListAllResponseAsync<TResponse, TAllResponse>({
listQueryConfig: this.listQueryConfig,
allResponseFactory: (items, responses) => this.allResponseFactory(items, responses),
getResponse: token => {
getResponse: (token) => {
if (token) {
this.xContinuationToken(token).toPromise();
this.xContinuationToken(token);
}

return this.toPromise();
Expand Down
3 changes: 1 addition & 2 deletions lib/services/base-management-service.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export abstract class BaseManagementQueryService<TCancelToken> {
return getType(filename);
}

private mapContentManagementError(error: any): SharedModels.ContentManagementBaseKontentError | any {
private mapContentManagementError(error: any): any {
let axiosError: AxiosError | undefined;

if (error.error) {
Expand Down Expand Up @@ -266,7 +266,6 @@ export abstract class BaseManagementQueryService<TCancelToken> {
}

return error;

}

/**
Expand Down
Loading

0 comments on commit b6ce5bb

Please sign in to comment.