mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
parent
8ceec0ffa3
commit
30fca567f6
7 changed files with 118 additions and 3 deletions
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsTypeMappingDefinition](./kibana-plugin-server.savedobjectstypemappingdefinition.md) > [dynamic](./kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md)
|
||||
|
||||
## SavedObjectsTypeMappingDefinition.dynamic property
|
||||
|
||||
The dynamic property of the mapping. either `false` or 'strict'. Defaults to strict
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
dynamic?: false | 'strict';
|
||||
```
|
|
@ -41,5 +41,6 @@ const typeDefinition: SavedObjectsTypeMappingDefinition = {
|
|||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [properties](./kibana-plugin-server.savedobjectstypemappingdefinition.properties.md) | <code>SavedObjectsMappingProperties</code> | |
|
||||
| [dynamic](./kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md) | <code>false | 'strict'</code> | The dynamic property of the mapping. either <code>false</code> or 'strict'. Defaults to strict |
|
||||
| [properties](./kibana-plugin-server.savedobjectstypemappingdefinition.properties.md) | <code>SavedObjectsMappingProperties</code> | The underlying properties of the type mapping |
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
## SavedObjectsTypeMappingDefinition.properties property
|
||||
|
||||
The underlying properties of the type mapping
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
* @public
|
||||
*/
|
||||
export interface SavedObjectsTypeMappingDefinition {
|
||||
/** The dynamic property of the mapping. either `false` or 'strict'. Defaults to strict */
|
||||
dynamic?: false | 'strict';
|
||||
/** The underlying properties of the type mapping */
|
||||
properties: SavedObjectsMappingProperties;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,3 +60,82 @@ Object {
|
|||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`buildActiveMappings handles the \`dynamic\` property of types 1`] = `
|
||||
Object {
|
||||
"_meta": Object {
|
||||
"migrationMappingPropertyHashes": Object {
|
||||
"config": "87aca8fdb053154f11383fce3dbf3edf",
|
||||
"firstType": "635418ab953d81d93f1190b70a8d3f57",
|
||||
"migrationVersion": "4a1746014a75ade3a714e1db5763276f",
|
||||
"namespace": "2f4316de49999235636386fe51dc06c1",
|
||||
"references": "7997cf5a56cc02bdc9c93361bde732b0",
|
||||
"secondType": "72d57924f415fbadb3ee293b67d233ab",
|
||||
"thirdType": "510f1f0adb69830cf8a1c5ce2923ed82",
|
||||
"type": "2f4316de49999235636386fe51dc06c1",
|
||||
"updated_at": "00da57df13e94e9d98437d13ace4bfe0",
|
||||
},
|
||||
},
|
||||
"dynamic": "strict",
|
||||
"properties": Object {
|
||||
"config": Object {
|
||||
"dynamic": "true",
|
||||
"properties": Object {
|
||||
"buildNum": Object {
|
||||
"type": "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
"firstType": Object {
|
||||
"dynamic": "strict",
|
||||
"properties": Object {
|
||||
"field": Object {
|
||||
"type": "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
"migrationVersion": Object {
|
||||
"dynamic": "true",
|
||||
"type": "object",
|
||||
},
|
||||
"namespace": Object {
|
||||
"type": "keyword",
|
||||
},
|
||||
"references": Object {
|
||||
"properties": Object {
|
||||
"id": Object {
|
||||
"type": "keyword",
|
||||
},
|
||||
"name": Object {
|
||||
"type": "keyword",
|
||||
},
|
||||
"type": Object {
|
||||
"type": "keyword",
|
||||
},
|
||||
},
|
||||
"type": "nested",
|
||||
},
|
||||
"secondType": Object {
|
||||
"dynamic": false,
|
||||
"properties": Object {
|
||||
"field": Object {
|
||||
"type": "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
"thirdType": Object {
|
||||
"properties": Object {
|
||||
"field": Object {
|
||||
"type": "text",
|
||||
},
|
||||
},
|
||||
},
|
||||
"type": Object {
|
||||
"type": "keyword",
|
||||
},
|
||||
"updated_at": Object {
|
||||
"type": "date",
|
||||
},
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { IndexMapping } from './../../mappings';
|
||||
import { IndexMapping, SavedObjectsTypeMappingDefinitions } from './../../mappings';
|
||||
import { buildActiveMappings, diffMappings } from './build_active_mappings';
|
||||
|
||||
describe('buildActiveMappings', () => {
|
||||
|
@ -49,6 +49,23 @@ describe('buildActiveMappings', () => {
|
|||
);
|
||||
});
|
||||
|
||||
test('handles the `dynamic` property of types', () => {
|
||||
const typeMappings: SavedObjectsTypeMappingDefinitions = {
|
||||
firstType: {
|
||||
dynamic: 'strict',
|
||||
properties: { field: { type: 'keyword' } },
|
||||
},
|
||||
secondType: {
|
||||
dynamic: false,
|
||||
properties: { field: { type: 'long' } },
|
||||
},
|
||||
thirdType: {
|
||||
properties: { field: { type: 'text' } },
|
||||
},
|
||||
};
|
||||
expect(buildActiveMappings(typeMappings)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('generated hashes are stable', () => {
|
||||
const properties = {
|
||||
aaa: { type: 'keyword', fields: { a: { type: 'keyword' }, b: { type: 'text' } } },
|
||||
|
|
|
@ -2058,7 +2058,7 @@ export interface SavedObjectsType {
|
|||
|
||||
// @public
|
||||
export interface SavedObjectsTypeMappingDefinition {
|
||||
// (undocumented)
|
||||
dynamic?: false | 'strict';
|
||||
properties: SavedObjectsMappingProperties;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue