Skip to content

Commit d8b6369

Browse files
committed
Regenerated client, added github workflows
1 parent aec5a6f commit d8b6369

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+499
-140
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publishing
2+
3+
on:
4+
push:
5+
branches-ignore: [ master ]
6+
7+
jobs:
8+
publish:
9+
name: Publish the client to the public registry
10+
runs-on: ubuntu-latest
11+
env:
12+
NPMRC: ${{ secrets.NPMRC }}
13+
strategy:
14+
matrix:
15+
node-version: ['18.x']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- run: |
24+
echo "$NPMRC" > ~/.npmrc
25+
npm publish
26+

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
name: Running basic tests
12+
runs-on: ubuntu-22.04
13+
strategy:
14+
matrix:
15+
node-version: ['18.x']
16+
17+
services:
18+
manticoresearch-manticore:
19+
image: manticoresearch/manticore:dev
20+
ports:
21+
- 9408:9308
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
- run: |
30+
npm install
31+
npm test
32+

.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
.travis.yml
55
README.md
66
docs/Aggregation.md
7+
docs/AggregationSortInnerValue.md
8+
docs/AggregationTerms.md
79
docs/BoolFilter.md
810
docs/BulkResponse.md
911
docs/DeleteDocumentRequest.md
@@ -53,6 +55,8 @@ src/api/SearchApi.js
5355
src/api/UtilsApi.js
5456
src/index.js
5557
src/model/Aggregation.js
58+
src/model/AggregationSortInnerValue.js
59+
src/model/AggregationTerms.js
5660
src/model/BoolFilter.js
5761
src/model/BulkResponse.js
5862
src/model/DeleteDocumentRequest.js
@@ -94,6 +98,8 @@ test/api/IndexApi.spec.js
9498
test/api/SearchApi.spec.js
9599
test/api/UtilsApi.spec.js
96100
test/model/Aggregation.spec.js
101+
test/model/AggregationSortInnerValue.spec.js
102+
test/model/AggregationTerms.spec.js
97103
test/model/BoolFilter.spec.js
98104
test/model/BulkResponse.spec.js
99105
test/model/DeleteDocumentRequest.spec.js

.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>manticoresearch-javascript</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
</buildSpec>
9+
<natures>
10+
</natures>
11+
</projectDescription>

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
Сlient for Manticore Search.
44

5-
65
❗ WARNING: this is a development version of the client. The latest release's readme is https://github.com/manticoresoftware/manticoresearch-javascript/tree/3.3.1
76

87
## Requirements
@@ -67,7 +66,7 @@ async function(){
6766

6867
## Documentation
6968

70-
Full documentation on the API Endpoints and Models used is available in [docs](https://github.com/manticoresoftware/manticoresearch-javascript/tree/3.3.1/docs) folder as listed below.
69+
Full documentation on the API Endpoints and Models used is available in [docs](https://github.com/manticoresoftware/manticoresearch-javascript/tree/4.0.0/docs) folder as listed below.
7170

7271
Manticore Search server documentation: https://manual.manticoresearch.com.
7372

@@ -90,6 +89,8 @@ Class | Method | HTTP request | Description
9089
## Documentation for Models
9190

9291
- [Manticoresearch.Aggregation](docs/Aggregation.md)
92+
- [Manticoresearch.AggregationSortInnerValue](docs/AggregationSortInnerValue.md)
93+
- [Manticoresearch.AggregationTerms](docs/AggregationTerms.md)
9394
- [Manticoresearch.BoolFilter](docs/BoolFilter.md)
9495
- [Manticoresearch.BulkResponse](docs/BulkResponse.md)
9596
- [Manticoresearch.DeleteDocumentRequest](docs/DeleteDocumentRequest.md)

docs/Aggregation.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**name** | **String** | |
8-
**field** | **String** | |
9-
**size** | **Number** | | [optional] [default to 20]
7+
**terms** | [**AggregationTerms**](AggregationTerms.md) | | [optional]
8+
**sort** | **[{String: AggregationSortInnerValue}]** | | [optional]
109

1110
[[Using in search requests]](SearchRequest.md#Aggregation)
1211

docs/AggregationSortInnerValue.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Manticoresearch.AggregationSortInnerValue
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**order** | **String** | | [optional]
8+
9+
10+
11+

docs/AggregationTerms.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Manticoresearch.AggregationTerms
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**field** | **String** | Attribute Name to Aggregate | [optional]
8+
**size** | **Number** | Maximum Number of Buckets in the Result | [optional]
9+
10+
11+
12+

docs/SearchRequest.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Name | Type | Description | Notes
1212
**offset** | **Number** | | [optional]
1313
**maxMatches** | **Number** | | [optional]
1414
**sort** | **[Object]** | | [optional]
15-
**aggs** | [**[Aggregation]**](Aggregation.md) | | [optional]
16-
**expressions** | **[Object]** | | [optional]
15+
**aggs** | [**{String: Aggregation}**](Aggregation.md) | | [optional]
16+
**expressions** | **{String: String}** | | [optional]
1717
**highlight** | [**Highlight**](Highlight.md) | | [optional]
1818
**source** | **Object** | | [optional]
1919
**options** | **{String: Object}** | | [optional]
@@ -110,10 +110,10 @@ var searchRequest = new Manticoresearch.SearchRequest();
110110
searchRequest.index = "movies";
111111
searchRequest.query = {"match_all": {}};
112112

113-
var expr = {'expr': 'min(year,2900)'};
114-
searchRequest.expressions = [expr];
115-
searchRequest.expressions.push({'expr2': 'max(year,2100)'});
116-
searchRequest.source.includes.push('expr2');
113+
var expr = {'expr1': 'min(year,2900)'};
114+
searchRequest.expressions = expr;
115+
searchRequest.expressions['expr2'] = 'max(year,2100)';
116+
searchRequest.source.includes.push('expr1', 'expr2');
117117

118118
async function(){
119119
var res = await searchApi.search(searchRequest);
@@ -132,10 +132,16 @@ var searchRequest = new Manticoresearch.SearchRequest();
132132
searchRequest.index = "movies";
133133
searchRequest.query = {"match_all": {}};
134134

135-
var agg1 = new Manticoresearch.Aggregation('agg1', 'year');
136-
Manticoresearch.Aggregation.constructFromObject({size:10}, agg1);
137-
searchRequest.aggs = [agg1];
138-
searchRequest.aggs.push(new Manticoresearch.Aggregation('agg2', 'rating'));
135+
var aggTerms = {};
136+
Manticoresearch.AggregationTerms.constructFromObject({field: 'year', size: 10}, aggTerms);
137+
var agg1 = new Manticoresearch.Aggregation();
138+
agg1['terms'] = aggTerms;
139+
agg1['sort'] = ['year'];
140+
searchRequest.aggs = {agg1: agg1};
141+
142+
var agg2 = new Manticoresearch.Aggregation();
143+
agg2['terms'] = Manticoresearch.AggregationTerms.constructFromObject({field: 'rating'});
144+
searchRequest.aggs['agg2'] = agg2;
139145

140146
async function(){
141147
var res = await searchApi.search(searchRequest);

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "manticoresearch",
3-
"version": "3.3.1",
3+
"version": "4.0.0",
44
"description": "Javascript client for Manticore Search",
55
"license": "MIT",
66
"main": "src/index.js",
@@ -18,11 +18,9 @@
1818
"index"
1919
],
2020
"dependencies": {
21-
"superagent": "5.1.0",
22-
"json-bigint": "1.0.0"
21+
"superagent": "5.1.0"
2322
},
2423
"devDependencies": {
25-
"inherits": "^2.0.4",
2624
"expect.js": "^0.3.1",
2725
"mocha": "^5.2.0",
2826
"sinon": "^7.2.0"

0 commit comments

Comments
 (0)