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
83 changes: 24 additions & 59 deletions src/apis/V1Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1472,12 +1472,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
JournalistSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return JournalistSchema.parse(raw);
}

/**
* Search and filter all news articles available via the Perigon API. The result includes a list of individual articles that were matched to your specific criteria.
* Articles
Expand Down Expand Up @@ -1509,12 +1506,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
QuerySearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return QuerySearchResultSchema.parse(raw);
}

/**
* Browse or search for companies Perigon tracks using name, domain, ticker symbol, industry, and more. Supports Boolean search logic and filtering by metadata such as country, exchange, employee count, and IPO date.
* Companies
Expand Down Expand Up @@ -1546,12 +1540,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
CompanySearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return CompanySearchResultSchema.parse(raw);
}

/**
* Search journalists using broad search attributes. Our database contains over 230,000 journalists from around the world and is refreshed frequently.
* Journalists
Expand Down Expand Up @@ -1583,12 +1574,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
JournalistSearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return JournalistSearchResultSchema.parse(raw);
}

/**
* Search and retrieve additional information on known persons that exist within Perigon\'s entity database and as referenced in any article response object. Our database contains over 650,000 people from around the world and is refreshed frequently. People data is derived from Wikidata and includes a wikidataId field that can be used to lookup even more information on Wikidata\'s website.
* People
Expand Down Expand Up @@ -1620,12 +1608,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
PeopleSearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return PeopleSearchResultSchema.parse(raw);
}

/**
* Search and filter the 142,000+ media sources available via the Perigon API. The result includes a list of individual media sources that were matched to your specific criteria.
* Sources
Expand Down Expand Up @@ -1657,12 +1642,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
SourceSearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return SourceSearchResultSchema.parse(raw);
}

/**
* Search and filter all news stories available via the Perigon API. Each story aggregates key information across related articles, including AI-generated names, summaries, and key points.
* Stories
Expand Down Expand Up @@ -1694,12 +1676,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
StorySearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return StorySearchResultSchema.parse(raw);
}

/**
* Produce a single, concise summary over the full corpus of articles matching your filters, using your prompt to guide which insights to highlight.
* Search Summarizer
Expand Down Expand Up @@ -1733,12 +1712,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
SummarySearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return SummarySearchResultSchema.parse(raw);
}

/**
* Search through all available Topics that exist within the Perigon Database.
* Topics
Expand Down Expand Up @@ -1770,12 +1746,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
TopicSearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return TopicSearchResultSchema.parse(raw);
}

/**
* Search and filter all Wikipedia pages available via the Perigon API. The result includes a list of individual pages that were matched to your specific criteria.
* Wikipedia
Expand Down Expand Up @@ -1807,12 +1780,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
WikipediaSearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return WikipediaSearchResultSchema.parse(raw);
}

/**
* Perform a natural language search over news articles from the past 6 months using semantic relevance. The result includes a list of articles most closely matched to your query intent.
* Vector
Expand Down Expand Up @@ -1845,12 +1815,9 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
ArticlesVectorSearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return ArticlesVectorSearchResultSchema.parse(raw);
}

/**
* Perform a natural language search over Wikipedia pages using semantic relevance. The result includes a list of page sections most closely matched to your query intent.
* Vector
Expand Down Expand Up @@ -1883,9 +1850,7 @@ export class V1Api extends runtime.BaseAPI {
initOverrides,
);

const apiResponse = new runtime.JSONApiResponse(response, (jsonValue) =>
WikipediaVectorSearchResultSchema.parse(jsonValue),
);
return await apiResponse.value();
const raw = await response.json();
return WikipediaVectorSearchResultSchema.parse(raw);
}
}
36 changes: 30 additions & 6 deletions src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,19 @@ export const ArticleSearchParamsSchema = z.object({
/**
* 'pubDateFrom' filter, will search articles published after the specified date, the date could be passed as ISO or 'yyyy-mm-dd'. Date time in ISO format, ie. 2024-01-01T00:00:00 - Default: Only articles with a pubDate within the last 30 days of the request
*/
pubDateFrom: z.string().optional().nullable(),
pubDateFrom: z
.union([z.string().date(), z.string().datetime()])
.transform((val) => new Date(val))
.optional()
.nullable(),
/**
* 'pubDateFrom' filter, will search articles published before the specified date, the date could be passed as ISO or 'yyyy-mm-dd'. Date time in ISO format, ie. 2024-01-01T00:00:00
*/
pubDateTo: z.string().optional().nullable(),
pubDateTo: z
.union([z.string().date(), z.string().datetime()])
.transform((val) => new Date(val))
.optional()
.nullable(),
/**
* Whether to return reprints in the response or not. Reprints are usually wired articles from sources like AP or Reuters that are reprinted in multiple sources at the same time. By default, this parameter is 'true'.
*/
Expand Down Expand Up @@ -1187,8 +1195,16 @@ export type TopicLabels = z.infer<typeof TopicLabelsSchema>;

export const TopicDtoSchema = z.object({
id: z.number().optional().nullable(),
createdAt: z.string().optional().nullable(),
updatedAt: z.string().optional().nullable(),
createdAt: z
.union([z.string().date(), z.string().datetime()])
.transform((val) => new Date(val))
.optional()
.nullable(),
updatedAt: z
.union([z.string().date(), z.string().datetime()])
.transform((val) => new Date(val))
.optional()
.nullable(),
name: z.string().optional().nullable(),
labels: TopicLabelsSchema.optional().nullable(),
});
Expand Down Expand Up @@ -1308,11 +1324,19 @@ export const WikipediaSearchParamsSchema = z.object({
/**
* 'wikiRevisionFrom' filter, will search pages modified after the specified date, the date could be passed as ISO or 'yyyy-mm-dd'. Date time in ISO format, ie. 2024-01-01T00:00:00.
*/
wikiRevisionFrom: z.string().optional().nullable(),
wikiRevisionFrom: z
.union([z.string().date(), z.string().datetime()])
.transform((val) => new Date(val))
.optional()
.nullable(),
/**
* 'wikiRevisionFrom' filter, will search pages modified before the specified date, the date could be passed as ISO or 'yyyy-mm-dd'. Date time in ISO format, ie. 2024-01-01T00:00:00.
*/
wikiRevisionTo: z.string().optional().nullable(),
wikiRevisionTo: z
.union([z.string().date(), z.string().datetime()])
.transform((val) => new Date(val))
.optional()
.nullable(),
/**
* 'pageviewsFrom' filter, will search pages with at least the provided number of views per day.
*/
Expand Down
Loading