Skip to content
Closed
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
26 changes: 0 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,3 @@ jobs:

- name: Test
run: ./gradlew test
publish:
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Java
id: setup-jre
uses: actions/setup-java@v1
with:
java-version: "11"
architecture: x64

- name: Publish to maven
run: |
./gradlew sonatypeCentralUpload
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_PUBLISH_REGISTRY_URL: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
MAVEN_SIGNATURE_KID: ${{ secrets.MAVEN_SIGNATURE_KID }}
MAVEN_SIGNATURE_SECRET_KEY: ${{ secrets.MAVEN_SIGNATURE_SECRET_KEY }}
MAVEN_SIGNATURE_PASSWORD: ${{ secrets.MAVEN_SIGNATURE_PASSWORD }}
8 changes: 0 additions & 8 deletions .publish/prepare.sh

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Pipedream Java Library

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FPipedreamHQ%2Fpipedream-sdk-java)
[![Maven Central](https://img.shields.io/maven-central/v/com.pipedream/pipedream)](https://central.sonatype.com/artifact/com.pipedream/pipedream)

The Pipedream Java library provides convenient access to the Pipedream API from Java.

Expand Down
82 changes: 1 addition & 81 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ plugins {
id 'java-library'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.11.0'
id 'signing'
id 'cl.franciscosolis.sonatype-central-upload' version '1.0.3'
}

repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}
}

Expand All @@ -19,7 +17,6 @@ dependencies {
api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2'
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2'
api 'org.apache.commons:commons-text:1.13.1'
api 'org.immutables:value:2.10.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
Expand All @@ -46,87 +43,10 @@ java {
}


group = 'com.pipedream'

version = '0.0.256'

jar {
dependsOn(":generatePomFileForMavenPublication")
archiveBaseName = "pipedream"
}

sourcesJar {
archiveBaseName = "pipedream"
}

javadocJar {
archiveBaseName = "pipedream"
}

signing {
sign(publishing.publications)
}

test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}

publishing {
publications {
maven(MavenPublication) {
groupId = 'com.pipedream'
artifactId = 'pipedream'
version = '0.0.256'
from components.java
pom {
name = 'pipedream'
description = 'The official SDK of pipedream'
url = 'https://buildwithfern.com'
licenses {
license {
name = 'The MIT License (MIT)'
url = 'https://mit-license.org/'
}
}
developers {
developer {
name = 'pipedream'
email = 'developers@pipedream.com'
}
}
scm {
connection = 'scm:git:git://github.com/PipedreamHQ/pipedream-sdk-java.git'
developerConnection = 'scm:git:git://github.com/PipedreamHQ/pipedream-sdk-java.git'
url = 'https://github.com/PipedreamHQ/pipedream-sdk-java'
}
}
}
}
}

sonatypeCentralUpload {
username = "$System.env.MAVEN_USERNAME"
password = "$System.env.MAVEN_PASSWORD"

archives = files(
"$buildDir/libs/pipedream-" + version + ".jar",
"$buildDir/libs/pipedream-" + version + "-sources.jar",
"$buildDir/libs/pipedream-" + version + "-javadoc.jar"
)

pom = file("$buildDir/publications/maven/pom-default.xml")
signingKey = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
signingKeyPassphrase = "$System.env.MAVEN_SIGNATURE_PASSWORD"
}

signing {
def signingKeyId = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
def signingPassword = "$System.env.MAVEN_SIGNATURE_PASSWORD"
useInMemoryPgpKeys(signingKeyId, signingPassword)
sign publishing.publications.maven
}

sonatypeCentralUpload.dependsOn build
Empty file removed gradle.properties
Empty file.
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
rootProject.name = 'pipedream'

include 'sample-app'
57 changes: 27 additions & 30 deletions src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.util.Optional;
import okhttp3.OkHttpClient;

public class AsyncBaseClientBuilder<T extends AsyncBaseClientBuilder<T>> {
public class AsyncBaseClientBuilder {
private Optional<Integer> timeout = Optional.empty();

private Optional<Integer> maxRetries = Optional.empty();
Expand All @@ -29,68 +29,65 @@ public class AsyncBaseClientBuilder<T extends AsyncBaseClientBuilder<T>> {
* Sets clientId.
* Defaults to the PIPEDREAM_CLIENT_ID environment variable.
*/
@SuppressWarnings("unchecked")
public T clientId(String clientId) {
public AsyncBaseClientBuilder clientId(String clientId) {
this.clientId = clientId;
return (T) this;
return this;
}

/**
* Sets clientSecret.
* Defaults to the PIPEDREAM_CLIENT_SECRET environment variable.
*/
@SuppressWarnings("unchecked")
public T clientSecret(String clientSecret) {
public AsyncBaseClientBuilder clientSecret(String clientSecret) {
this.clientSecret = clientSecret;
return (T) this;
return this;
}

/**
* Sets projectEnvironment
*/
@SuppressWarnings("unchecked")
public T projectEnvironment(String projectEnvironment) {
public AsyncBaseClientBuilder projectEnvironment(String projectEnvironment) {
this.projectEnvironment = projectEnvironment;
return (T) this;
return this;
}

@SuppressWarnings("unchecked")
public T environment(Environment environment) {
public AsyncBaseClientBuilder environment(Environment environment) {
this.environment = environment;
return (T) this;
return this;
}

@SuppressWarnings("unchecked")
public T url(String url) {
public AsyncBaseClientBuilder url(String url) {
this.environment = Environment.custom(url);
return (T) this;
return this;
}

/**
* Sets the timeout (in seconds) for the client. Defaults to 60 seconds.
*/
@SuppressWarnings("unchecked")
public T timeout(int timeout) {
public AsyncBaseClientBuilder timeout(int timeout) {
this.timeout = Optional.of(timeout);
return (T) this;
return this;
}

/**
* Sets the maximum number of retries for the client. Defaults to 2 retries.
*/
@SuppressWarnings("unchecked")
public T maxRetries(int maxRetries) {
public AsyncBaseClientBuilder maxRetries(int maxRetries) {
this.maxRetries = Optional.of(maxRetries);
return (T) this;
return this;
}

/**
* Sets the underlying OkHttp client
*/
@SuppressWarnings("unchecked")
public T httpClient(OkHttpClient httpClient) {
public AsyncBaseClientBuilder httpClient(OkHttpClient httpClient) {
this.httpClient = httpClient;
return (T) this;
return this;
}

public AsyncBaseClientBuilder projectId(String projectId) {
clientOptionsBuilder.projectId(projectId);
return this;
}

protected ClientOptions buildClientOptions() {
Expand Down Expand Up @@ -124,7 +121,7 @@ protected void setEnvironment(ClientOptions.Builder builder) {
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void setAuthentication(ClientOptions.Builder builder) {
* super.setAuthentication(builder); // Keep existing auth
* builder.addHeader("X-API-Key", this.apiKey);
Expand All @@ -149,7 +146,7 @@ protected void setAuthentication(ClientOptions.Builder builder) {
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void setCustomHeaders(ClientOptions.Builder builder) {
* super.setCustomHeaders(builder); // Keep existing headers
* builder.addHeader("X-Trace-ID", generateTraceId());
Expand Down Expand Up @@ -215,9 +212,9 @@ protected void setHttpClient(ClientOptions.Builder builder) {
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void setAdditional(ClientOptions.Builder builder) {
* builder.addHeader("X-Request-ID", () -> UUID.randomUUID().toString());
* builder.addHeader("X-Request-ID", () -&gt; UUID.randomUUID().toString());
* builder.addHeader("X-Client-Version", "1.0.0");
* }
* }</pre>
Expand All @@ -231,7 +228,7 @@ protected void setAdditional(ClientOptions.Builder builder) {}
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void validateConfiguration() {
* super.validateConfiguration(); // Run parent validations
* if (tenantId == null || tenantId.isEmpty()) {
Expand Down
Loading
Loading