Skip to content

Commit 9aeaf58

Browse files
committed
feat: resolve conflicts and merge with main
2 parents 12922c4 + 1bb1322 commit 9aeaf58

File tree

238 files changed

+35194
-145
lines changed

Some content is hidden

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

238 files changed

+35194
-145
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ module.exports = {
3535
// there's a conflict when declaring `type` and `namespaces`, even with `ignoreDeclarationMerge`
3636
'no-redeclare': 0,
3737
'@typescript-eslint/no-redeclare': 0,
38+
// Some endpoints have A LOT of parameters
39+
'max-params': 0,
3840

3941
'@typescript-eslint/no-unused-vars': 2,
4042
'unused-imports/no-unused-imports-ts': 2,

.github/actions/cache/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ runs:
2222
with:
2323
path: '**/node_modules'
2424
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
25+
26+
- name: Restore maven dependencies.
27+
uses: actions/cache@v2
28+
with:
29+
path: '~/.m2/repository'
30+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

.github/workflows/check.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
- name: Checking personalization specs
3030
run: yarn specs personalization
3131

32+
- name: Checking analytics specs
33+
run: yarn specs analytics
34+
3235
- name: Lint
3336
run: yamllint specs
3437

@@ -59,12 +62,33 @@ jobs:
5962
- name: Build personalization client
6063
run: yarn client:build-js:personalization
6164

65+
- name: Generate analytics client
66+
run: yarn generate javascript analytics
67+
68+
- name: Build analytics client
69+
run: yarn client:build-js:analytics
70+
6271
- name: Lint
6372
run: yarn lint
6473

74+
client_java:
75+
runs-on: ubuntu-20.04
76+
needs: [setup, specs]
77+
steps:
78+
- uses: actions/checkout@v2
79+
80+
- name: Restore cache
81+
uses: ./.github/actions/cache
82+
83+
- name: Generate search client
84+
run: yarn generate java search
85+
86+
- name: Build search client
87+
run: yarn client:build-java
88+
6589
cts:
6690
runs-on: ubuntu-20.04
67-
needs: [setup, specs, client_javascript]
91+
needs: [setup, specs, client_javascript, client_java]
6892
steps:
6993
- uses: actions/checkout@v2
7094

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ yarn-error.log
1010
!.yarn/releases
1111
!.yarn/plugins
1212

13-
**/node_modules
14-
**/dist
13+
.vscode/
14+
.idea/
1515

16-
.vscode
16+
target
17+
**/.DS_Store
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
*.class
2+
3+
# Mobile Tools for Java (J2ME)
4+
.mtj.tmp/
5+
6+
# Package Files #
7+
*.jar
8+
*.war
9+
*.ear
10+
11+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
12+
hs_err_pid*
13+
14+
# build files
15+
**/target
16+
target
17+
.gradle
18+
build
19+
20+
.openapi-generator
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
api/**
8+
docs/**
9+
gradle/**
10+
src/**
11+
12+
.travis.yml
13+
build.gradle
14+
build.sbt
15+
git_push.sh
16+
gradle*
17+
settings.gradle
18+
19+
# Selective source file
20+
algoliasearch-core/com/algolia/auth/**
21+
algoliasearch-core/com/algolia/Configuration.java
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# algoliasearch-client-java-2
2+
3+
Search API
4+
- API version: 0.1.0
5+
6+
API powering the Search feature of Algolia.
7+
8+
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
9+
10+
## Requirements
11+
12+
Building the API client library requires:
13+
1. Java 1.8+
14+
2. Maven/Gradle
15+
16+
## Installation
17+
18+
To install the API client library to your local Maven repository, simply execute:
19+
20+
```shell
21+
mvn clean install
22+
```
23+
24+
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
25+
26+
```shell
27+
mvn clean deploy
28+
```
29+
30+
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
31+
32+
### Maven users
33+
34+
Add this dependency to your project's POM:
35+
36+
```xml
37+
<dependency>
38+
<groupId>com.algolia</groupId>
39+
<artifactId>algoliasearch-client-java-2</artifactId>
40+
<version>0.1.0</version>
41+
<scope>compile</scope>
42+
</dependency>
43+
```
44+
45+
### Gradle users
46+
47+
Add this dependency to your project's build file:
48+
49+
```groovy
50+
compile "com.algolia:algoliasearch-client-java-2:0.1.0"
51+
```
52+
53+
### Others
54+
55+
At first generate the JAR by executing:
56+
57+
```shell
58+
mvn clean package
59+
```
60+
61+
Then manually install the following JARs:
62+
63+
* `target/algoliasearch-client-java-2-0.1.0.jar`
64+
* `target/lib/*.jar`
65+
66+
## Getting Started
67+
68+
Checkout the playground.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package com.algolia;
2+
3+
import java.io.IOException;
4+
import java.util.List;
5+
import java.util.Map;
6+
7+
/**
8+
* Callback for asynchronous API call.
9+
*
10+
* @param <T> The return type
11+
*/
12+
public interface ApiCallback<T> {
13+
/**
14+
* This is called when the API call fails.
15+
*
16+
* @param e The exception causing the failure
17+
* @param statusCode Status code of the response if available, otherwise it would be 0
18+
* @param responseHeaders Headers of the response if available, otherwise it would be null
19+
*/
20+
void onFailure(
21+
ApiException e,
22+
int statusCode,
23+
Map<String, List<String>> responseHeaders
24+
);
25+
26+
/**
27+
* This is called when the API call succeeded.
28+
*
29+
* @param result The result deserialized from response
30+
* @param statusCode Status code of the response
31+
* @param responseHeaders Headers of the response
32+
*/
33+
void onSuccess(
34+
T result,
35+
int statusCode,
36+
Map<String, List<String>> responseHeaders
37+
);
38+
39+
/**
40+
* This is called when the API upload processing.
41+
*
42+
* @param bytesWritten bytes Written
43+
* @param contentLength content length of request body
44+
* @param done write end
45+
*/
46+
void onUploadProgress(long bytesWritten, long contentLength, boolean done);
47+
48+
/**
49+
* This is called when the API download processing.
50+
*
51+
* @param bytesRead bytes Read
52+
* @param contentLength content length of the response
53+
* @param done Read end
54+
*/
55+
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
56+
}

0 commit comments

Comments
 (0)