Skip to content

Commit 280cdd4

Browse files
committed
feat: complete java sdk v0 foundation and typed complement models
1 parent 52bc6a4 commit 280cdd4

144 files changed

Lines changed: 5715 additions & 967 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Build artifacts
2+
target/
3+
4+
# Local Maven cache override used in this workspace
5+
.m2/
6+
7+
# IDE files
8+
.idea/
9+
*.iml
10+
.vscode/
11+
12+
# OS files
13+
.DS_Store

README.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,36 @@
22

33
Official Java SDK for [Facturapi](https://www.facturapi.io).
44

5+
[![CI](https://img.shields.io/github/actions/workflow/status/facturapi/facturapi-java/ci.yml?branch=main&style=for-the-badge&label=CI)](https://github.com/facturapi/facturapi-java/actions/workflows/ci.yml)
6+
[![Maven Central](https://img.shields.io/maven-central/v/io.facturapi/facturapi-java?style=for-the-badge&label=Maven%20Central)](https://central.sonatype.com/artifact/io.facturapi/facturapi-java)
7+
[![Java](https://img.shields.io/badge/Java-11%2B-ED8B00?style=for-the-badge&logo=openjdk&logoColor=white)](https://openjdk.org/)
8+
59
## Requirements
610

711
- Java 11+
8-
- Maven 3.8+
912

1013
## Installation
1114

15+
Maven:
16+
1217
```xml
1318
<dependency>
1419
<groupId>io.facturapi</groupId>
1520
<artifactId>facturapi-java</artifactId>
16-
<version>1.0.0</version>
21+
<version>0.1.0</version>
1722
</dependency>
1823
```
1924

25+
Gradle:
26+
27+
```gradle
28+
implementation("io.facturapi:facturapi-java:0.1.0")
29+
```
30+
2031
## Quickstart
2132

2233
```java
23-
import com.facturapi.Facturapi;
34+
import io.facturapi.Facturapi;
2435
import java.util.Map;
2536

2637
Facturapi facturapi = new Facturapi("sk_test_...");
@@ -33,11 +44,19 @@ var customer = facturapi.customers.create(Map.of(
3344
), null);
3445

3546
var invoice = facturapi.invoices.create(Map.of(
36-
"customer", customer.get("id").asText(),
47+
"customer", customer.getId(),
3748
"items", java.util.List.of(Map.of("quantity", 1, "product", "prod_123"))
3849
), null);
50+
51+
System.out.println(invoice.getId());
3952
```
4053

54+
## Design
55+
56+
- Inputs use flexible JSON dictionaries (`Map<String, Object>`).
57+
- Outputs are typed Java models (`Invoice`, `Customer`, `SearchResult<T>`, etc.).
58+
- Auth uses `Authorization: Bearer <apiKey>`.
59+
4160
## Configuration
4261

4362
```java
@@ -46,9 +65,3 @@ Facturapi facturapi = Facturapi.builder("sk_test_...")
4665
.timeout(java.time.Duration.ofSeconds(20))
4766
.build();
4867
```
49-
50-
## Notes
51-
52-
- Uses `Authorization: Bearer <apiKey>`.
53-
- Supports custom base URL for integration testing.
54-
- Includes compatibility aliases (`all`, `del`, `lisLiveApiKeys`).

pom.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>io.facturapi</groupId>
77
<artifactId>facturapi-java</artifactId>
8-
<version>1.0.0-SNAPSHOT</version>
8+
<version>0.1.0-SNAPSHOT</version>
99
<name>facturapi-java</name>
1010
<description>Official Java SDK for Facturapi</description>
1111
<url>https://github.com/facturapi/facturapi-java</url>
@@ -22,7 +22,6 @@
2222
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2323
<jackson.version>2.17.2</jackson.version>
2424
<junit.version>5.11.0</junit.version>
25-
<okhttp.version>4.12.0</okhttp.version>
2625
</properties>
2726

2827
<dependencies>
@@ -38,12 +37,6 @@
3837
<version>${junit.version}</version>
3938
<scope>test</scope>
4039
</dependency>
41-
<dependency>
42-
<groupId>com.squareup.okhttp3</groupId>
43-
<artifactId>mockwebserver</artifactId>
44-
<version>${okhttp.version}</version>
45-
<scope>test</scope>
46-
</dependency>
4740
</dependencies>
4841

4942
<build>

src/main/java/com/facturapi/resources/BaseResource.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/main/java/com/facturapi/resources/CustomersResource.java

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/main/java/com/facturapi/resources/InvoicesResource.java

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)