6 Commits

Author SHA1 Message Date
Andrew Stein
1f9c48eac6 Merge remote-tracking branch 'origin/main' 2023-09-03 13:55:48 -04:00
Andrew Stein
b3ea0e2a09 Updated POM.xml 2023-09-03 13:55:35 -04:00
Andrew Stein
75eb64a077 Update README.md 2023-09-03 13:55:18 -04:00
Andrew Stein
c5706317aa Updated build name. 2023-06-11 19:36:05 -04:00
Andrew Stein
0a2f6d1869 Reorganized files. 2023-06-11 19:35:13 -04:00
Andrew Stein
b753769a53 Updated POM version. 2023-06-11 19:33:09 -04:00
10 changed files with 98 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
name: Dev Build
name: Build
on:
push:

View File

@@ -14,9 +14,9 @@ I downgraded the repo from JDK 17 to JDK 11 as well.
To add `elevenlabs-api` to your Maven project, use:
```xml
<dependency>
<groupId>net.andrewcpu.elevenlabs</groupId>
<groupId>net.andrewcpu</groupId>
<artifactId>elevenlabs-api</artifactId>
<version>2.0-SNAPSHOT</version>
<version>2.1</version>
</dependency>
```
The most up-to date package information can be found on the [Packages tab](https://github.com/AndrewCPU/elevenlabs-api/packages/)

95
pom.xml
View File

@@ -6,6 +6,7 @@
<name>Unofficial Java ElevenLabs Voice API</name>
<description>An API level interaction between Java and the ElevenLabs Voice Generation Web API.</description>
<url>https://github.com/AndrewCPU/elevenlabs-api</url>
<developers>
<developer>
<id>Andrewcpu</id>
@@ -24,17 +25,42 @@
<tag>HEAD</tag>
</scm>
<distributionManagement>
<repository>
<profiles>
<profile>
<id>github</id>
<name>GitHub AndrewCPU Apache Maven Packages</name>
<url>https://maven.pkg.github.com/AndrewCPU/elevenlabs-api</url>
</repository>
</distributionManagement>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub AndrewCPU Apache Maven Packages</name>
<url>https://maven.pkg.github.com/AndrewCPU/elevenlabs-api</url>
</repository>
</distributionManagement>
</profile>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
<groupId>net.andrewcpu</groupId>
<artifactId>elevenlabs-api</artifactId>
<version>2.0-SNAPSHOT</version>
<version>2.1</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
@@ -94,6 +120,20 @@
<build>
<finalName>elevenlabs-api-${version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
@@ -114,6 +154,47 @@
</execution>
</executions>
</plugin>
<!-- Generates JAR's source file -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<!-- Generates Javadoc JAR file -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,4 +1,4 @@
package net.andrewcpu.elevenlabs;
package net.andrewcpu.elevenlabs.enums;
public enum HttpRequestType {
POST, GET, PUT, DELETE;

View File

@@ -1,6 +1,6 @@
package net.andrewcpu.elevenlabs.requests;
import net.andrewcpu.elevenlabs.HttpRequestType;
import net.andrewcpu.elevenlabs.enums.HttpRequestType;
public abstract class DeleteRequest<T> extends ElevenLabsRequest<T> {
public DeleteRequest(String endpoint, Class<T> clazz) {

View File

@@ -1,6 +1,6 @@
package net.andrewcpu.elevenlabs.requests;
import net.andrewcpu.elevenlabs.HttpRequestType;
import net.andrewcpu.elevenlabs.enums.HttpRequestType;
public abstract class ElevenLabsRequest<T> {
private HttpRequestType type;

View File

@@ -1,6 +1,6 @@
package net.andrewcpu.elevenlabs.requests;
import net.andrewcpu.elevenlabs.HttpRequestType;
import net.andrewcpu.elevenlabs.enums.HttpRequestType;
public abstract class GetRequest<T> extends ElevenLabsRequest<T> {
public GetRequest(String endpoint, Class<T> clazz) {

View File

@@ -1,6 +1,6 @@
package net.andrewcpu.elevenlabs.requests;
import net.andrewcpu.elevenlabs.HttpRequestType;
import net.andrewcpu.elevenlabs.enums.HttpRequestType;
public abstract class PostRequest<T> extends ElevenLabsRequest<T> {
public PostRequest(String endpoint, Class<T> clazz) {

View File

@@ -1,6 +1,6 @@
package net.andrewcpu.elevenlabs.requests;
import net.andrewcpu.elevenlabs.HttpRequestType;
import net.andrewcpu.elevenlabs.enums.HttpRequestType;
public abstract class PutRequest<T> extends ElevenLabsRequest<T> {
public PutRequest(String endpoint, Class<T> clazz) {

View File

@@ -3,12 +3,10 @@ package net.andrewcpu.elevenlabs.util;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.andrewcpu.elevenlabs.ElevenLabs;
import net.andrewcpu.elevenlabs.HttpRequestType;
import net.andrewcpu.elevenlabs.enums.HttpRequestType;
import net.andrewcpu.elevenlabs.exceptions.ValidationException;
import net.andrewcpu.elevenlabs.model.error.ValidationError;
import org.apache.hc.client5.http.classic.HttpClient;
import org.apache.hc.client5.http.classic.methods.*;
import org.apache.hc.client5.http.entity.UrlEncodedFormEntity;
import org.apache.hc.client5.http.entity.mime.FileBody;
import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
@@ -23,8 +21,6 @@ import org.apache.hc.core5.net.URIBuilder;
import java.io.*;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.security.interfaces.DSAParams;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;