"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toSavedObjectContract = exports.toClientContract = void 0; /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ const toClientContract = (attributes, agentPolicies) => { return { locations: attributes.locations.map(location => ({ label: location.label, id: location.id, agentPolicyId: location.agentPolicyId, concurrentMonitors: location.concurrentMonitors, isServiceManaged: false, isInvalid: !Boolean(agentPolicies === null || agentPolicies === void 0 ? void 0 : agentPolicies.find(policy => policy.id === location.agentPolicyId)), tags: location.tags, geo: location.geo })) }; }; exports.toClientContract = toClientContract; const toSavedObjectContract = location => { return { label: location.label, id: location.id, agentPolicyId: location.agentPolicyId, concurrentMonitors: location.concurrentMonitors, tags: location.tags, isServiceManaged: false, geo: location.geo }; }; exports.toSavedObjectContract = toSavedObjectContract;