public-api-finder 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "public-api-finder",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Find free/public APIs for agents and prototypes.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -119,7 +119,7 @@ function cleanDescription(desc) {
119
119
  .replace(/[#*_`>\[\]()]/g, '')
120
120
  .replace(/\s+/g, ' ')
121
121
  .trim()
122
- .slice(0, 280);
122
+ .slice(0, 260).replace(/\s+\S{0,20}$/, '');
123
123
  }
124
124
 
125
125
  function normalizeAuth(auth) {
@@ -167,7 +167,7 @@ function parseApisGuru(data) {
167
167
  const origin = info['x-origin']?.[0]?.url;
168
168
  entries.push({
169
169
  name: info.title || providerName,
170
- url: (info.contact?.url && !String(info.contact.url).startsWith('file:')) ? info.contact.url : ((origin && !String(origin).startsWith('file:')) ? origin : `https://${providerName}`),
170
+ url: (info.contact?.url && !String(info.contact.url).startsWith('file:')) ? info.contact.url : ((origin && !String(origin).startsWith('file:')) ? origin : (version?.swaggerUrl || version?.openapiUrl || `https://api.apis.guru/v2/specs/${providerName}/${item.preferred || 'latest'}/openapi.json`)),
171
171
  description: cleanDescription(info.description || `OpenAPI definition for ${providerName}`),
172
172
  auth: 'Unknown',
173
173
  https: true,