mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Usage Collection] [schema] reporting
+ add MappedType
support (#78591)
This commit is contained in:
parent
8282dd7066
commit
66866d0af1
10 changed files with 1403 additions and 9 deletions
|
@ -124,4 +124,18 @@ describe('getDescriptor', () => {
|
|||
'@@INDEX@@': { kind: ts.SyntaxKind.NumberKeyword, type: 'NumberKeyword' },
|
||||
});
|
||||
});
|
||||
|
||||
it('serializes MappedTypes', () => {
|
||||
const usageInterface = usageInterfaces.get('MappedTypes')!;
|
||||
const descriptor = getDescriptor(usageInterface, tsProgram);
|
||||
expect(descriptor).toEqual({
|
||||
mappedTypeWithExternallyDefinedProps: {
|
||||
prop1: { kind: ts.SyntaxKind.NumberKeyword, type: 'NumberKeyword' },
|
||||
prop2: { kind: ts.SyntaxKind.NumberKeyword, type: 'NumberKeyword' },
|
||||
},
|
||||
mappedTypeWithOneInlineProp: {
|
||||
prop3: { kind: ts.SyntaxKind.NumberKeyword, type: 'NumberKeyword' },
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -71,6 +71,33 @@ export function kindToDescriptorName(kind: number) {
|
|||
}
|
||||
}
|
||||
|
||||
export function getConstraints(node: ts.Node, program: ts.Program): any {
|
||||
if (ts.isTypeReferenceNode(node)) {
|
||||
const typeChecker = program.getTypeChecker();
|
||||
const symbol = typeChecker.getSymbolAtLocation(node.typeName);
|
||||
const declaration = (symbol?.getDeclarations() || [])[0];
|
||||
if (declaration) {
|
||||
return getConstraints(declaration, program);
|
||||
}
|
||||
return getConstraints(node.typeName, program);
|
||||
}
|
||||
|
||||
if (ts.isTypeAliasDeclaration(node)) {
|
||||
return getConstraints(node.type, program);
|
||||
}
|
||||
|
||||
if (ts.isUnionTypeNode(node)) {
|
||||
const types = node.types.filter(discardNullOrUndefined);
|
||||
return types.map((typeNode) => getConstraints(typeNode, program));
|
||||
}
|
||||
|
||||
if (ts.isLiteralTypeNode(node) && ts.isLiteralExpression(node.literal)) {
|
||||
return node.literal.text;
|
||||
}
|
||||
|
||||
throw Error(`Unsupported constraint`);
|
||||
}
|
||||
|
||||
export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor | DescriptorValue {
|
||||
if (ts.isMethodSignature(node) || ts.isPropertySignature(node)) {
|
||||
if (node.type) {
|
||||
|
@ -89,8 +116,19 @@ export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor |
|
|||
}
|
||||
|
||||
// If it's defined as signature { [key: string]: OtherInterface }
|
||||
if (ts.isIndexSignatureDeclaration(node) && node.type) {
|
||||
return { '@@INDEX@@': getDescriptor(node.type, program) };
|
||||
if ((ts.isIndexSignatureDeclaration(node) || ts.isMappedTypeNode(node)) && node.type) {
|
||||
const descriptor = getDescriptor(node.type, program);
|
||||
|
||||
// If we know the constraints of `string` ({ [key in 'prop1' | 'prop2']: value })
|
||||
const constraint = (node as ts.MappedTypeNode).typeParameter?.constraint;
|
||||
if (constraint) {
|
||||
const constraints = getConstraints(constraint, program);
|
||||
const constraintsArray = Array.isArray(constraints) ? constraints : [constraints];
|
||||
if (typeof constraintsArray[0] === 'string') {
|
||||
return constraintsArray.reduce((acc, c) => ({ ...acc, [c]: descriptor }), {});
|
||||
}
|
||||
}
|
||||
return { '@@INDEX@@': descriptor };
|
||||
}
|
||||
|
||||
if (ts.SyntaxKind.FirstNode === node.kind) {
|
||||
|
|
|
@ -124,7 +124,9 @@ export function getVariableValue(node: ts.Node, program: ts.Program): string | R
|
|||
}
|
||||
|
||||
throw Error(
|
||||
`Unsupported Node: cannot get value of node (${node.getText()}) of kind ${node.kind}`
|
||||
`Unsupported Node: cannot get value of node (${node.getText()}) of kind ${node.kind} [${
|
||||
ts.SyntaxKind[node.kind]
|
||||
}]`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,3 +55,14 @@ export const externallyDefinedSchema: MakeSchemaFrom<{ locale: string }> = {
|
|||
export type TypeAliasWithUnion = Usage & WithUnion;
|
||||
|
||||
export type TypeAliasWithRecord = Usage & Record<string, number>;
|
||||
|
||||
export type MappedTypeProps = 'prop1' | 'prop2';
|
||||
|
||||
export interface MappedTypes {
|
||||
mappedTypeWithExternallyDefinedProps: {
|
||||
[key in MappedTypeProps]: number;
|
||||
};
|
||||
mappedTypeWithOneInlineProp: {
|
||||
[key in 'prop3']: number;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
"plugins/alerts/server/usage/alerts_usage_collector.ts",
|
||||
"plugins/apm/server/lib/apm_telemetry/index.ts",
|
||||
"plugins/infra/server/usage/usage_collector.ts",
|
||||
"plugins/reporting/server/usage/reporting_usage_collector.ts",
|
||||
"plugins/maps/server/maps_telemetry/collectors/register.ts"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -467,6 +467,575 @@ describe('Ready for collection observable', () => {
|
|||
"fetch": [Function],
|
||||
"formatForBulkUpload": [Function],
|
||||
"isReady": [Function],
|
||||
"schema": Object {
|
||||
"PNG": Object {
|
||||
"available": Object {
|
||||
"type": "boolean",
|
||||
},
|
||||
"total": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"_all": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"available": Object {
|
||||
"type": "boolean",
|
||||
},
|
||||
"browser_type": Object {
|
||||
"type": "keyword",
|
||||
},
|
||||
"csv": Object {
|
||||
"available": Object {
|
||||
"type": "boolean",
|
||||
},
|
||||
"total": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"enabled": Object {
|
||||
"type": "boolean",
|
||||
},
|
||||
"last7Days": Object {
|
||||
"PNG": Object {
|
||||
"available": Object {
|
||||
"type": "boolean",
|
||||
},
|
||||
"total": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"_all": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"csv": Object {
|
||||
"available": Object {
|
||||
"type": "boolean",
|
||||
},
|
||||
"total": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"app": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"available": Object {
|
||||
"type": "boolean",
|
||||
},
|
||||
"layout": Object {
|
||||
"preserve_layout": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"print": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"total": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"status": Object {
|
||||
"cancelled": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"completed": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"completed_with_warnings": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"failed": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"pending": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"processing": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"statuses": Object {
|
||||
"cancelled": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"completed": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"completed_with_warnings": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"failed": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"pending": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"processing": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"app": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"available": Object {
|
||||
"type": "boolean",
|
||||
},
|
||||
"layout": Object {
|
||||
"preserve_layout": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"print": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"total": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"status": Object {
|
||||
"cancelled": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"completed": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"completed_with_warnings": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"failed": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"pending": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"processing": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"statuses": Object {
|
||||
"cancelled": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"completed": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"completed_with_warnings": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"failed": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"pending": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"processing": Object {
|
||||
"PNG": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"csv": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
"printable_pdf": Object {
|
||||
"canvas workpad": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"dashboard": Object {
|
||||
"type": "long",
|
||||
},
|
||||
"visualization": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"type": "reporting",
|
||||
}
|
||||
`);
|
||||
|
|
|
@ -13,6 +13,7 @@ import { ReportingSetupDeps } from '../types';
|
|||
import { GetLicense } from './';
|
||||
import { getReportingUsage } from './get_reporting_usage';
|
||||
import { ReportingUsageType } from './types';
|
||||
import { reportingSchema } from './schema';
|
||||
|
||||
// places the reporting data as kibana stats
|
||||
const METATYPE = 'kibana_stats';
|
||||
|
@ -41,6 +42,7 @@ export function getReportingUsageCollector(
|
|||
return getReportingUsage(config, getLicense, callCluster, exportTypesRegistry);
|
||||
},
|
||||
isReady,
|
||||
schema: reportingSchema,
|
||||
/*
|
||||
* Format the response data into a model for internal upload
|
||||
* 1. Make this data part of the "kibana_stats" type
|
||||
|
|
67
x-pack/plugins/reporting/server/usage/schema.ts
Normal file
67
x-pack/plugins/reporting/server/usage/schema.ts
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { MakeSchemaFrom } from 'src/plugins/usage_collection/server';
|
||||
import { AppCounts, AvailableTotal, JobTypes, RangeStats, ReportingUsageType } from './types';
|
||||
|
||||
const appCountsSchema: MakeSchemaFrom<AppCounts> = {
|
||||
'canvas workpad': { type: 'long' },
|
||||
dashboard: { type: 'long' },
|
||||
visualization: { type: 'long' },
|
||||
};
|
||||
|
||||
const byAppCountsSchema: MakeSchemaFrom<RangeStats['statuses']['cancelled']> = {
|
||||
csv: appCountsSchema,
|
||||
PNG: appCountsSchema,
|
||||
printable_pdf: appCountsSchema,
|
||||
};
|
||||
|
||||
const availableTotalSchema: MakeSchemaFrom<AvailableTotal> = {
|
||||
available: { type: 'boolean' },
|
||||
total: { type: 'long' },
|
||||
};
|
||||
|
||||
const jobTypesSchema: MakeSchemaFrom<JobTypes> = {
|
||||
csv: availableTotalSchema,
|
||||
PNG: availableTotalSchema,
|
||||
printable_pdf: {
|
||||
...availableTotalSchema,
|
||||
app: appCountsSchema,
|
||||
layout: {
|
||||
print: { type: 'long' },
|
||||
preserve_layout: { type: 'long' },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const rangeStatsSchema: MakeSchemaFrom<RangeStats> = {
|
||||
...jobTypesSchema,
|
||||
_all: { type: 'long' },
|
||||
status: {
|
||||
cancelled: { type: 'long' },
|
||||
completed: { type: 'long' },
|
||||
completed_with_warnings: { type: 'long' },
|
||||
failed: { type: 'long' },
|
||||
pending: { type: 'long' },
|
||||
processing: { type: 'long' },
|
||||
},
|
||||
statuses: {
|
||||
cancelled: byAppCountsSchema,
|
||||
completed: byAppCountsSchema,
|
||||
completed_with_warnings: byAppCountsSchema,
|
||||
failed: byAppCountsSchema,
|
||||
pending: byAppCountsSchema,
|
||||
processing: byAppCountsSchema,
|
||||
},
|
||||
};
|
||||
|
||||
export const reportingSchema: MakeSchemaFrom<ReportingUsageType> = {
|
||||
...rangeStatsSchema,
|
||||
available: { type: 'boolean' },
|
||||
browser_type: { type: 'keyword' },
|
||||
enabled: { type: 'boolean' },
|
||||
last7Days: rangeStatsSchema,
|
||||
};
|
|
@ -162,8 +162,3 @@ export interface SearchResponse {
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface AvailableTotal {
|
||||
available: boolean;
|
||||
total: number;
|
||||
}
|
||||
|
|
|
@ -754,6 +754,703 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"reporting": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"available": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"total": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"available": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"total": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"available": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"total": {
|
||||
"type": "long"
|
||||
},
|
||||
"app": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"layout": {
|
||||
"properties": {
|
||||
"print": {
|
||||
"type": "long"
|
||||
},
|
||||
"preserve_layout": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"_all": {
|
||||
"type": "long"
|
||||
},
|
||||
"status": {
|
||||
"properties": {
|
||||
"cancelled": {
|
||||
"type": "long"
|
||||
},
|
||||
"completed": {
|
||||
"type": "long"
|
||||
},
|
||||
"completed_with_warnings": {
|
||||
"type": "long"
|
||||
},
|
||||
"failed": {
|
||||
"type": "long"
|
||||
},
|
||||
"pending": {
|
||||
"type": "long"
|
||||
},
|
||||
"processing": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"statuses": {
|
||||
"properties": {
|
||||
"cancelled": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"completed": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"completed_with_warnings": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"failed": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pending": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"processing": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"available": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"browser_type": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"last7Days": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"available": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"total": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"available": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"total": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"available": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"total": {
|
||||
"type": "long"
|
||||
},
|
||||
"app": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"layout": {
|
||||
"properties": {
|
||||
"print": {
|
||||
"type": "long"
|
||||
},
|
||||
"preserve_layout": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"_all": {
|
||||
"type": "long"
|
||||
},
|
||||
"status": {
|
||||
"properties": {
|
||||
"cancelled": {
|
||||
"type": "long"
|
||||
},
|
||||
"completed": {
|
||||
"type": "long"
|
||||
},
|
||||
"completed_with_warnings": {
|
||||
"type": "long"
|
||||
},
|
||||
"failed": {
|
||||
"type": "long"
|
||||
},
|
||||
"pending": {
|
||||
"type": "long"
|
||||
},
|
||||
"processing": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"statuses": {
|
||||
"properties": {
|
||||
"cancelled": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"completed": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"completed_with_warnings": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"failed": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pending": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"processing": {
|
||||
"properties": {
|
||||
"csv": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PNG": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"printable_pdf": {
|
||||
"properties": {
|
||||
"canvas workpad": {
|
||||
"type": "long"
|
||||
},
|
||||
"dashboard": {
|
||||
"type": "long"
|
||||
},
|
||||
"visualization": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"rollups": {
|
||||
"properties": {
|
||||
"index_patterns": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue