"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.policiesQueryParamsSchema = void 0; var _configSchema = require("@kbn/config-schema"); var _constants = require("../constants"); /* * 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 policiesQueryParamsSchema = _configSchema.schema.object({ /** * The page of objects to return */ page: _configSchema.schema.number({ defaultValue: 1, min: 1 }), /** * The number of objects to include in each page */ per_page: _configSchema.schema.number({ defaultValue: _constants.DEFAULT_POLICIES_PER_PAGE, min: 0 }), /** * Once of PackagePolicy fields for sorting the found objects. * Sortable fields: * - package_policy.id * - package_policy.name * - package_policy.policy_id * - package_policy.namespace * - package_policy.updated_at * - package_policy.updated_by * - package_policy.created_at * - package_policy.created_by, * - package_policy.package.name * - package_policy.package.title * - package_policy.package.version */ sort_field: _configSchema.schema.oneOf([_configSchema.schema.literal('package_policy.id'), _configSchema.schema.literal('package_policy.name'), _configSchema.schema.literal('package_policy.policy_id'), _configSchema.schema.literal('package_policy.namespace'), _configSchema.schema.literal('package_policy.updated_at'), _configSchema.schema.literal('package_policy.updated_by'), _configSchema.schema.literal('package_policy.created_at'), _configSchema.schema.literal('package_policy.created_by'), _configSchema.schema.literal('package_policy.package.name'), _configSchema.schema.literal('package_policy.package.title')], { defaultValue: 'package_policy.name' }), /** * The order to sort by */ sort_order: _configSchema.schema.oneOf([_configSchema.schema.literal('asc'), _configSchema.schema.literal('desc')], { defaultValue: 'asc' }), /** * Policy filter */ policy_name: _configSchema.schema.maybe(_configSchema.schema.string()) }); exports.policiesQueryParamsSchema = policiesQueryParamsSchema;