New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

seobot

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seobot - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

1

dist/blog/client.d.ts
import { Blog } from '../types';
export declare class BlogClient {
private _key;
private _axios;
constructor(key: string);

@@ -5,0 +6,0 @@ private _decompressIndex;

81

dist/blog/client.js

@@ -16,4 +16,5 @@ "use strict";

exports.BlogClient = void 0;
const axios_1 = __importDefault(require("axios"));
const slugify_1 = __importDefault(require("slugify"));
const transliteration_1 = __importDefault(require("transliteration"));
const transliteration_1 = require("transliteration");
class BlogClient {

@@ -24,2 +25,5 @@ constructor(key) {

this._key = key;
this._axios = axios_1.default.create({
baseURL: 'https://cdn.seobotai.com',
});
}

@@ -39,3 +43,3 @@ _decompressIndex(short) {

title: short.c.t,
slug: short.c.s || (0, slugify_1.default)(transliteration_1.default.transliterate(short.c.t), { lower: true, strict: true }),
slug: short.c.s || (0, slugify_1.default)((0, transliteration_1.transliterate)(short.c.t), { lower: true, strict: true }),
}

@@ -45,3 +49,3 @@ : null,

title: i.t,
slug: i.s || (0, slugify_1.default)(transliteration_1.default.transliterate(i.t), { lower: true, strict: true }),
slug: i.s || (0, slugify_1.default)((0, transliteration_1.transliterate)(i.t), { lower: true, strict: true }),
})),

@@ -52,5 +56,4 @@ };

return __awaiter(this, void 0, void 0, function* () {
const response = yield fetch(`https://cdn.seobotai.com/${this._key}/system/base.json`);
const index = (yield response.json());
return index.map(i => this._decompressIndex(i)).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
const { data } = yield this._axios.get(`/${this._key}/system/base.json`);
return data.map(i => this._decompressIndex(i)).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
});

@@ -60,5 +63,4 @@ }

return __awaiter(this, void 0, void 0, function* () {
const postData = yield fetch(`https://cdn.seobotai.com/${this._key}/blog/${id}.json`);
const post = (yield postData.json());
return post;
const { data } = yield this._axios.get(`/${this._key}/blog/${id}.json`);
return data;
});

@@ -68,14 +70,9 @@ }

return __awaiter(this, void 0, void 0, function* () {
try {
const base = yield this._fetchIndex();
const start = page * limit;
const end = start + limit;
return {
articles: base.slice(start, end),
total: base.length,
};
}
catch (_a) {
return { total: 0, articles: [] };
}
const base = yield this._fetchIndex();
const start = page * limit;
const end = start + limit;
return {
articles: base.slice(start, end),
total: base.length,
};
});

@@ -85,15 +82,10 @@ }

return __awaiter(this, void 0, void 0, function* () {
try {
const base = yield this._fetchIndex();
const categoryIds = base.filter(i => { var _a; return ((_a = i.category) === null || _a === void 0 ? void 0 : _a.slug) == slug; }).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
const start = page * limit;
const end = start + limit;
return {
articles: categoryIds.slice(start, end),
total: categoryIds.length,
};
}
catch (_a) {
return { total: 0, articles: [] };
}
const base = yield this._fetchIndex();
const categoryIds = base.filter(i => { var _a; return ((_a = i.category) === null || _a === void 0 ? void 0 : _a.slug) == slug; }).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
const start = page * limit;
const end = start + limit;
return {
articles: categoryIds.slice(start, end),
total: categoryIds.length,
};
});

@@ -103,15 +95,10 @@ }

return __awaiter(this, void 0, void 0, function* () {
try {
const base = yield this._fetchIndex();
const tags = base.filter(i => i.tags.some(item => (item === null || item === void 0 ? void 0 : item.slug) === slug)).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
const start = page * limit;
const end = start + limit;
return {
articles: tags.slice(start, end),
total: tags.length,
};
}
catch (_a) {
return { total: 0, articles: [] };
}
const base = yield this._fetchIndex();
const tags = base.filter(i => i.tags.some(item => (item === null || item === void 0 ? void 0 : item.slug) === slug)).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
const start = page * limit;
const end = start + limit;
return {
articles: tags.slice(start, end),
total: tags.length,
};
});

@@ -118,0 +105,0 @@ }

{
"name": "seobot",
"version": "1.2.0",
"version": "1.3.0",
"description": "Client library for the SEObot API",

@@ -16,9 +16,16 @@ "main": "dist/index.js",

"scripts": {
"build": "tsc"
"build": "tsc",
"test": "jest",
"test:watch": "jest --watch"
},
"devDependencies": {
"@types/jest": "^29.5.14",
"jest": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"prettier": "^3.1.0",
"ts-jest": "^29.2.5",
"typescript": "^5.2.2"
},
"dependencies": {
"axios": "^1.7.9",
"slugify": "^1.6.6",

@@ -25,0 +32,0 @@ "transliteration": "^2.3.5"

@@ -80,2 +80,3 @@ # [SEObot](https://seobotai.com/?utm_source=github) Blog API Client library

html: string;
markdown: string;
outline: string;

@@ -82,0 +83,0 @@ deleted: boolean;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc