UNPKG

@kontent-ai/management-sdk

Version:
25 lines 1.35 kB
import { CustomAppModels } from '../models'; import { CustomAppsResponses } from '../responses'; import { BaseMapper } from './base-mapper'; export class CustomAppMapper extends BaseMapper { mapGetCustomAppResponse(response) { return new CustomAppsResponses.GetCustomAppResponse(super.mapResponseDebug(response), response.data, this.mapCustomApp(response.data)); } mapListCustomAppsResponse(response) { return new CustomAppsResponses.CustomAppsListResponse(super.mapResponseDebug(response), response.data, { pagination: super.mapPagination(response.data.pagination), items: response.data.custom_apps.map((m) => this.mapCustomApp(m)) }); } mapModifyCustomAppResponse(response) { return new CustomAppsResponses.ModifyCustomAppResponse(super.mapResponseDebug(response), response.data, this.mapCustomApp(response.data)); } mapAddCustomAppResponse(response) { return new CustomAppsResponses.AddCustomAppResponse(super.mapResponseDebug(response), response.data, this.mapCustomApp(response.data)); } mapCustomApp(rawCustomApp) { return new CustomAppModels.CustomApp(Object.assign(Object.assign({}, rawCustomApp), { _raw: rawCustomApp })); } } export const customAppMapper = new CustomAppMapper(); //# sourceMappingURL=custom-app-mapper.js.map