Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"cliVersion": "5.50.6",
"cliVersion": "5.66.0",
"generatorName": "fernapi/fern-java-sdk",
"generatorVersion": "4.10.16",
"generatorVersion": "4.11.1",
"generatorConfig": {
"publish-to": "central",
"client-class-name": "CatchAllApi",
"package-prefix": "com.newscatcher.catchall"
},
"originGitCommit": "f9a7ba07dda24e9d9936bb543686bc542355479e",
"originGitCommit": "1e66c85a387d0d844162c965656c6a0d36334c11",
"originGitCommitIsDirty": true,
"invokedBy": "ci",
"requestedVersion": "AUTO",
"ciProvider": "unknown",
"sdkVersion": "3.0.2"
"sdkVersion": "3.0.3"
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Add the dependency in your `build.gradle` file:

```groovy
dependencies {
implementation 'com.newscatcherapi:newscatcher-catchall-sdk:3.0.2'
implementation 'com.newscatcherapi:newscatcher-catchall-sdk:3.0.3'
}
```

Expand All @@ -47,7 +47,7 @@ Add the dependency in your `pom.xml` file:
<dependency>
<groupId>com.newscatcherapi</groupId>
<artifactId>newscatcher-catchall-sdk</artifactId>
<version>3.0.2</version>
<version>3.0.3</version>
</dependency>
```

Expand Down Expand Up @@ -265,3 +265,4 @@ On the other hand, contributions to the README are always very welcome!




46 changes: 30 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
if (JavaVersion.current().isJava11Compatible()) {
classpath 'cl.franciscosolis:SonatypeCentralUpload:1.0.3'
}
}
}

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 {
Expand Down Expand Up @@ -47,7 +57,7 @@ java {

group = 'com.newscatcherapi'

version = '3.0.2'
version = '3.0.3'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -78,7 +88,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.newscatcherapi'
artifactId = 'newscatcher-catchall-sdk'
version = '3.0.2'
version = '3.0.3'
from components.java
pom {
name = 'newscatcher'
Expand All @@ -105,19 +115,25 @@ publishing {
}
}

sonatypeCentralUpload {
username = "$System.env.MAVEN_USERNAME"
password = "$System.env.MAVEN_PASSWORD"
if (JavaVersion.current().isJava11Compatible()) {
apply plugin: 'cl.franciscosolis.sonatype-central-upload'

archives = files(
"$buildDir/libs/newscatcher-catchall-sdk-" + version + ".jar",
"$buildDir/libs/newscatcher-catchall-sdk-" + version + "-sources.jar",
"$buildDir/libs/newscatcher-catchall-sdk-" + version + "-javadoc.jar"
)
sonatypeCentralUpload {
username = "$System.env.MAVEN_USERNAME"
password = "$System.env.MAVEN_PASSWORD"

pom = file("$buildDir/publications/maven/pom-default.xml")
signingKey = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
signingKeyPassphrase = "$System.env.MAVEN_SIGNATURE_PASSWORD"
archives = files(
"$buildDir/libs/newscatcher-catchall-sdk-" + version + ".jar",
"$buildDir/libs/newscatcher-catchall-sdk-" + version + "-sources.jar",
"$buildDir/libs/newscatcher-catchall-sdk-" + version + "-javadoc.jar"
)

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

sonatypeCentralUpload.dependsOn build
}

signing {
Expand All @@ -127,5 +143,3 @@ signing {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications.maven
}

sonatypeCentralUpload.dependsOn build
125 changes: 114 additions & 11 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ client.jobs().createJob(
Custom validators for filtering web page clusters.

If not provided, validators are generated automatically based on the query.
The system may also inject validators during the `analyzing` stage — for
example, converting a relative time qualifier into an explicit event-date
gate. The returned `validators[]` in the job status shows the complete
applied set, including any system-added ones.

</dd>
</dl>
Expand Down Expand Up @@ -1714,7 +1718,7 @@ Authentication forwarded with each delivery. Supported types:
<dl>
<dd>

**formatterConfig:** `Optional<Map<String, Object>>` — Custom payload transformation configuration. Required only when `type` is `custom`.
**formatterConfig:** `Optional<FormatterConfigDto>` — Custom payload formatter. Required when `type` is `custom`.

</dd>
</dl>
Expand Down Expand Up @@ -1967,7 +1971,7 @@ client.webhooks().updateWebhook(
<dl>
<dd>

**formatterConfig:** `Optional<Map<String, Object>>` — Updated formatter configuration.
**formatterConfig:** `Optional<FormatterConfigDto>` — Updated custom payload formatter. Set only when `type` is `custom`.

</dd>
</dl>
Expand Down Expand Up @@ -2396,6 +2400,101 @@ client.webhooks().listWebhooksForResource(
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.webhooks.triggerWebhook(resourceType, resourceId)</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Manually dispatches a webhook delivery for a resource on demand, without
waiting for the next job or monitor cycle.

Use this to re-deliver results after a failed delivery, replay a specific
job's results, or validate a webhook against live data. The webhook must
already be assigned to the resource.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```java
client.webhooks().triggerWebhook(
MappableResourceType.JOB,
"3fec5b07-8786-46d7-9486-d43ff67eccd4",
TriggerWebhookRequest
.builder()
.webhookId("a1b2c3d4-e5f6-7890-abcd-ef1234567890")
.jobId("3fec5b07-8786-46d7-9486-d43ff67eccd4")
.build()
);
```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**resourceType:** `MappableResourceType`

</dd>
</dl>

<dl>
<dd>

**resourceId:** `String` — Unique resource identifier.

</dd>
</dl>

<dl>
<dd>

**webhookId:** `String` — Identifier of the webhook to trigger. Must be assigned to the resource.

</dd>
</dl>

<dl>
<dd>

**jobId:** `Optional<String>`

Specific job run to deliver. Optional for `job` resources; for
`monitor` and `monitor_group` resources, selects a past run to replay.
When omitted, the latest available results are delivered.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -2608,10 +2707,10 @@ client.entities().listEntities(

Creates a new company entity and begins background enrichment.

Each entity requires a `name` plus at least one of: a `description` or a `domain`. Providing both is recommended — `domain` is the highest-signal identifier because it is unambiguous; a well-written `description` is the best alternative when no domain is available.

The entity status starts as `pending` and transitions to `ready` once
enrichment completes. Provide as much identifying information as
possible — `domain` is the highest-signal field because it is
unambiguous.
enrichment completes.
</dd>
</dl>
</dd>
Expand All @@ -2631,7 +2730,7 @@ client.entities().createEntity(
.builder()
.name("NewsCatcher")
.entityType(EntityType.COMPANY)
.description("AI-powered news data provider")
.description("NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).")
.additionalAttributes(
AdditionalAttributes
.builder()
Expand All @@ -2646,7 +2745,7 @@ client.entities().createEntity(
)
.alternativeNames(
Optional.of(
Arrays.asList("NC", "NewsCatcher API")
Arrays.asList("NewsCatcher CatchAll", "NewsCatcher API")
)
)
.build()
Expand Down Expand Up @@ -2695,6 +2794,8 @@ client.entities().createEntity(

Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.

Each entity requires a `name` plus at least one of: a `description` or a `domain`. See [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) for the full field reference.

Returns an array of `{id, status}` objects in the same order as the input array.
</dd>
</dl>
Expand Down Expand Up @@ -2956,7 +3057,7 @@ client.entities().updateEntity(
.builder()
.alternativeNames(
Optional.of(
Arrays.asList("NC", "NewsCatcher API", "NCA")
Arrays.asList("NewsCatcher CatchAll", "NewsCatcher API", "NCA")
)
)
.build()
Expand Down Expand Up @@ -3152,7 +3253,9 @@ client.datasets().listDatasets(
<dl>
<dd>

Creates a new dataset from a list of existing entity IDs.
Creates a new dataset from a list of existing entity IDs. The optional `description` field here describes the dataset itself — it is separate from the entity-level `description` used for matching.

Entities must be created before adding them to a dataset. Each entity requires a `name` plus at least one of: a `description` or a `domain`. Use [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) or [Create entities batch](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entities-batch) to create entities first.

If any of the provided entity IDs do not exist or do not belong to
your organization, the request fails with `400`. All entity IDs must
Expand Down Expand Up @@ -3240,12 +3343,12 @@ client.datasets().createDataset(
<dl>
<dd>

Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The `name` and `domain`columns are required; all other columns are optional.
Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. Each row requires a `name` plus at least one of: a `description` or a `domain`; all other columns are optional. Note: `description` in the CSV is the entity's matching description — it is separate from the dataset-level `description` field in the form data.

**CSV format:**
```csv
name,description,domain,alternative_names,key_persons
NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
NewsCatcher,"NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",newscatcherapi.com,"NewsCatcher CatchAll;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
OpenAI,"Artificial intelligence research company",openai.com,"Open AI","Sam Altman"
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap<String, String>() {
{
put("User-Agent", "com.newscatcherapi:newscatcher-catchall-sdk/3.0.2");
put("User-Agent", "com.newscatcherapi:newscatcher-catchall-sdk/3.0.3");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.newscatcher.fern:api-sdk");
put("X-Fern-SDK-Version", "3.0.2");
put("X-Fern-SDK-Version", "3.0.3");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import java.time.temporal.TemporalQueries;

/**
* Custom deserializer that handles converting ISO8601 dates into {@link OffsetDateTime} objects.
* Custom deserializer that handles converting date-time strings into {@link OffsetDateTime} objects.
* Supports ISO 8601 format, space-separated variants, and RFC 1123 (RFC 2822) format.
*/
class DateTimeDeserializer extends JsonDeserializer<OffsetDateTime> {
private static final SimpleModule MODULE;
Expand Down Expand Up @@ -48,9 +49,15 @@ public OffsetDateTime deserialize(JsonParser parser, DeserializationContext cont
try {
temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest(value, OffsetDateTime::from, LocalDateTime::from);
} catch (DateTimeParseException e) {
// Fall back to space-separated format (e.g. "2025-02-15 10:30:00+00:00").
temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest(
value.replace(' ', 'T'), OffsetDateTime::from, LocalDateTime::from);
try {
// Fall back to space-separated format (e.g. "2025-02-15 10:30:00+00:00").
temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest(
value.replace(' ', 'T'), OffsetDateTime::from, LocalDateTime::from);
} catch (DateTimeParseException e2) {
// Fall back to RFC 1123 format (e.g. "Thu, 07 May 2026 14:23:38 +0000").
temporal = DateTimeFormatter.RFC_1123_DATE_TIME.parseBest(
value, OffsetDateTime::from, LocalDateTime::from);
}
}

if (temporal.query(TemporalQueries.offset()) == null) {
Expand Down
Loading
Loading