Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
[options]
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
esproposal.class_instance_fields=enable
esproposal.optional_chaining=enable
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ cache:
notifications:
email: true
node_js:
- "12"
- "10"
- "8"
before_install:
- curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.2.deb && sudo dpkg -i --force-confnew elasticsearch-5.2.2.deb && sudo service elasticsearch restart
before_script:
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"eslint.validate": ["javascript"],
"javascript.validate.enable": false,
"javascript.autoClosingTags": false,
"eslint.autoFixOnSave": true
"eslint.autoFixOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,36 @@
"graphql-compose": "^7.0.4"
},
"devDependencies": {
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.4",
"@babel/node": "^7.6.3",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
"@babel/plugin-transform-flow-strip-types": "^7.6.3",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.6.3",
"@babel/preset-flow": "^7.0.0",
"aws-sdk": "^2.561.0",
"@babel/cli": "7.8.4",
"@babel/core": "7.8.4",
"@babel/node": "7.8.4",
"@babel/plugin-proposal-class-properties": "7.8.3",
"@babel/plugin-proposal-object-rest-spread": "7.8.3",
"@babel/plugin-transform-flow-strip-types": "7.8.3",
"@babel/plugin-transform-runtime": "7.8.3",
"@babel/preset-env": "7.8.4",
"@babel/preset-flow": "7.8.3",
"aws-sdk": "2.612.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"elasticsearch": "^16.5.0",
"eslint": "^6.6.0",
"babel-jest": "25.1.0",
"elasticsearch": "16.6.0",
"eslint": "6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.5.0",
"eslint-plugin-flowtype": "^4.3.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^3.1.1",
"eslint-config-prettier": "6.10.0",
"eslint-plugin-flowtype": "4.6.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-prettier": "3.1.2",
"express": "^4.17.1",
"express-graphql": "^0.9.0",
"flow-bin": "0.110.0",
"graphql": "^14.5.8",
"graphql-compose": "^7.4.2",
"jest": "^24.9.0",
"nodemon": "^1.19.4",
"graphql": "14.6.0",
"graphql-compose": "7.10.0",
"jest": "25.1.0",
"nodemon": "2.0.2",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"rimraf": "^3.0.0",
"prettier": "1.19.1",
"rimraf": "3.0.1",
"semantic-release": "^15.13.28"
},
"scripts": {
Expand Down
15 changes: 9 additions & 6 deletions src/elasticDSL/Aggs/__tests__/Aggs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ describe('AGGS args converter', () => {
});

it('convertAggsBlocks()', () => {
expect(convertAggsBlocks([{ key: 'field1', value: {} }, { key: 'field2', value: {} }])).toEqual(
{
field1: {},
field2: {},
}
);
expect(
convertAggsBlocks([
{ key: 'field1', value: {} },
{ key: 'field2', value: {} },
])
).toEqual({
field1: {},
field2: {},
});
});

it('should convert recursively aggs', () => {
Expand Down
8 changes: 4 additions & 4 deletions src/elasticDSL/Aggs/__tests__/__snapshots__/Aggs-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ input Elastic_AggsDateHistogram_50 {
offset: String

\\"\\"\\"
Date Format/Patter. Eg \\"MM-yyy\\" returns \\"08-2012\\". [JodaDate](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
Date Format/Patter. Eg MM-yyy returns 08-2012. [JodaDate](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
\\"\\"\\"
format: String
missing: String
Expand All @@ -201,7 +201,7 @@ input Elastic_AggsDateRange_50 {
field: String

\\"\\"\\"
Date Format/Patter. Eg \\"MM-yyy\\" returns \\"08-2012\\". [JodaDate](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
Date Format/Patter. Eg MM-yyy returns 08-2012. [JodaDate](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
\\"\\"\\"
format: String
ranges: [Elastic_DateRange_50]
Expand Down Expand Up @@ -965,7 +965,7 @@ input Elastic_QueryMatchAll_50 {
}

\\"\\"\\"
The More Like This Query (MLT Query) finds documents that are \\"like\\" a given set of documents. [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
The More Like This Query (MLT Query) finds documents that are like a given set of documents. [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
\\"\\"\\"
input Elastic_QueryMoreLikeThis_50 {
fields: [String]
Expand All @@ -983,7 +983,7 @@ input Elastic_QueryMultiMatch_50 {
query: String!

\\"\\"\\"
Array of fields [ \\"title\\", \\"*_name\\", \\"subject^3\\" ]. You may use wildcards and boosting field.
Array of fields [ title, *_name, subject^3 ]. You may use wildcards and boosting field.
\\"\\"\\"
fields: [String]!
type: Elastic_QueryMultiMatchTypeEnum_50
Expand Down
2 changes: 1 addition & 1 deletion src/elasticDSL/Commons/Date.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function getDateFormatFC(
type: 'String',
description: desc(
`
Date Format/Patter. Eg "MM-yyy" returns "08-2012".
Date Format/Patter. Eg MM-yyy returns 08-2012.
[JodaDate](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
`
),
Expand Down
2 changes: 1 addition & 1 deletion src/elasticDSL/Query/FullText/MultiMatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function getMultiMatchITC<TContext>(
type: '[String]!',
description: desc(
`
Array of fields [ "title", "*_name", "subject^3" ].
Array of fields [ title, *_name, subject^3 ].
You may use wildcards and boosting field.
`
),
Expand Down
2 changes: 1 addition & 1 deletion src/elasticDSL/Query/Specialized/MoreLikeThis.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function getMoreLikeThisITC<TContext>(
const name = getTypeName('QueryMoreLikeThis', opts);
const description = desc(
`
The More Like This Query (MLT Query) finds documents that are "like" a given set of documents.
The More Like This Query (MLT Query) finds documents that are like a given set of documents.
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ input Elastic_QueryMatchAll_50 {
}

\\"\\"\\"
The More Like This Query (MLT Query) finds documents that are \\"like\\" a given set of documents. [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
The More Like This Query (MLT Query) finds documents that are like a given set of documents. [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
\\"\\"\\"
input Elastic_QueryMoreLikeThis_50 {
fields: [String]
Expand All @@ -295,7 +295,7 @@ input Elastic_QueryMultiMatch_50 {
query: String!

\\"\\"\\"
Array of fields [ \\"title\\", \\"*_name\\", \\"subject^3\\" ]. You may use wildcards and boosting field.
Array of fields [ title, *_name, subject^3 ]. You may use wildcards and boosting field.
\\"\\"\\"
fields: [String]!
type: Elastic_QueryMultiMatchTypeEnum_50
Expand Down
10 changes: 6 additions & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,12 @@ export async function fetchElasticMapping(
);
}

const elasticMapping = (await opts.elasticClient.indices.getMapping({
index: opts.elasticIndex,
type: opts.elasticType,
}))[opts.elasticIndex].mappings[opts.elasticType];
const elasticMapping = (
await opts.elasticClient.indices.getMapping({
index: opts.elasticIndex,
type: opts.elasticType,
})
)[opts.elasticIndex].mappings[opts.elasticType];

return elasticMapping;
}
Loading