@getlatedev/node
Advanced tools
+19
-13
@@ -29,3 +29,5 @@ "use strict"; | ||
| ValidationError: () => ValidationError, | ||
| default: () => Late, | ||
| Zernio: () => Zernio, | ||
| ZernioApiError: () => ZernioApiError, | ||
| default: () => Zernio, | ||
| parseApiError: () => parseApiError | ||
@@ -1386,6 +1388,6 @@ }); | ||
| // src/errors.ts | ||
| var LateApiError = class _LateApiError extends Error { | ||
| var ZernioApiError = class _ZernioApiError extends Error { | ||
| constructor(message, statusCode, code, details) { | ||
| super(message); | ||
| this.name = "LateApiError"; | ||
| this.name = "ZernioApiError"; | ||
| this.statusCode = statusCode; | ||
@@ -1395,3 +1397,3 @@ this.code = code; | ||
| if (Error.captureStackTrace) { | ||
| Error.captureStackTrace(this, _LateApiError); | ||
| Error.captureStackTrace(this, _ZernioApiError); | ||
| } | ||
@@ -1436,3 +1438,4 @@ } | ||
| }; | ||
| var RateLimitError = class extends LateApiError { | ||
| var LateApiError = ZernioApiError; | ||
| var RateLimitError = class extends ZernioApiError { | ||
| constructor(message, limit, remaining, resetAt) { | ||
@@ -1453,3 +1456,3 @@ super(message, 429, "rate_limit_exceeded"); | ||
| }; | ||
| var ValidationError = class extends LateApiError { | ||
| var ValidationError = class extends ZernioApiError { | ||
| constructor(message, fields) { | ||
@@ -1479,9 +1482,9 @@ super(message, 400, "validation_error", { fields }); | ||
| } | ||
| return new LateApiError(message, response.status, code, details); | ||
| return new ZernioApiError(message, response.status, code, details); | ||
| } | ||
| // src/client.ts | ||
| var Late = class { | ||
| var Zernio = class { | ||
| /** | ||
| * Create a new Late API client. | ||
| * Create a new Zernio API client. | ||
| * | ||
@@ -1833,6 +1836,6 @@ * @param options - Configuration options for the client | ||
| }; | ||
| const apiKey = options.apiKey ?? process.env["LATE_API_KEY"]; | ||
| const apiKey = options.apiKey ?? process.env["ZERNIO_API_KEY"] ?? process.env["LATE_API_KEY"]; | ||
| if (!apiKey) { | ||
| throw new LateApiError( | ||
| "The LATE_API_KEY environment variable is missing or empty; either provide it, or instantiate the Late client with an apiKey option, like new Late({ apiKey: 'sk_...' }).", | ||
| throw new ZernioApiError( | ||
| "The ZERNIO_API_KEY environment variable is missing or empty; either provide it, or instantiate the Zernio client with an apiKey option, like new Zernio({ apiKey: 'sk_...' }). LATE_API_KEY is also supported for backwards compatibility.", | ||
| 401, | ||
@@ -1843,3 +1846,3 @@ "missing_api_key" | ||
| this.apiKey = apiKey; | ||
| this.baseURL = options.baseURL ?? "https://getlate.dev/api"; | ||
| this.baseURL = options.baseURL ?? "https://zernio.com/api"; | ||
| this._options = options; | ||
@@ -1871,2 +1874,3 @@ client.setConfig({ | ||
| }; | ||
| var Late = Zernio; | ||
| // Annotate the CommonJS export names for ESM import in node: | ||
@@ -1878,3 +1882,5 @@ 0 && (module.exports = { | ||
| ValidationError, | ||
| Zernio, | ||
| ZernioApiError, | ||
| parseApiError | ||
| }); |
+17
-13
@@ -1356,6 +1356,6 @@ var __defProp = Object.defineProperty; | ||
| // src/errors.ts | ||
| var LateApiError = class _LateApiError extends Error { | ||
| var ZernioApiError = class _ZernioApiError extends Error { | ||
| constructor(message, statusCode, code, details) { | ||
| super(message); | ||
| this.name = "LateApiError"; | ||
| this.name = "ZernioApiError"; | ||
| this.statusCode = statusCode; | ||
@@ -1365,3 +1365,3 @@ this.code = code; | ||
| if (Error.captureStackTrace) { | ||
| Error.captureStackTrace(this, _LateApiError); | ||
| Error.captureStackTrace(this, _ZernioApiError); | ||
| } | ||
@@ -1406,3 +1406,4 @@ } | ||
| }; | ||
| var RateLimitError = class extends LateApiError { | ||
| var LateApiError = ZernioApiError; | ||
| var RateLimitError = class extends ZernioApiError { | ||
| constructor(message, limit, remaining, resetAt) { | ||
@@ -1423,3 +1424,3 @@ super(message, 429, "rate_limit_exceeded"); | ||
| }; | ||
| var ValidationError = class extends LateApiError { | ||
| var ValidationError = class extends ZernioApiError { | ||
| constructor(message, fields) { | ||
@@ -1449,9 +1450,9 @@ super(message, 400, "validation_error", { fields }); | ||
| } | ||
| return new LateApiError(message, response.status, code, details); | ||
| return new ZernioApiError(message, response.status, code, details); | ||
| } | ||
| // src/client.ts | ||
| var Late = class { | ||
| var Zernio = class { | ||
| /** | ||
| * Create a new Late API client. | ||
| * Create a new Zernio API client. | ||
| * | ||
@@ -1803,6 +1804,6 @@ * @param options - Configuration options for the client | ||
| }; | ||
| const apiKey = options.apiKey ?? process.env["LATE_API_KEY"]; | ||
| const apiKey = options.apiKey ?? process.env["ZERNIO_API_KEY"] ?? process.env["LATE_API_KEY"]; | ||
| if (!apiKey) { | ||
| throw new LateApiError( | ||
| "The LATE_API_KEY environment variable is missing or empty; either provide it, or instantiate the Late client with an apiKey option, like new Late({ apiKey: 'sk_...' }).", | ||
| throw new ZernioApiError( | ||
| "The ZERNIO_API_KEY environment variable is missing or empty; either provide it, or instantiate the Zernio client with an apiKey option, like new Zernio({ apiKey: 'sk_...' }). LATE_API_KEY is also supported for backwards compatibility.", | ||
| 401, | ||
@@ -1813,3 +1814,3 @@ "missing_api_key" | ||
| this.apiKey = apiKey; | ||
| this.baseURL = options.baseURL ?? "https://getlate.dev/api"; | ||
| this.baseURL = options.baseURL ?? "https://zernio.com/api"; | ||
| this._options = options; | ||
@@ -1841,2 +1842,3 @@ client.setConfig({ | ||
| }; | ||
| var Late = Zernio; | ||
| export { | ||
@@ -1847,4 +1849,6 @@ Late, | ||
| ValidationError, | ||
| Late as default, | ||
| Zernio, | ||
| ZernioApiError, | ||
| Zernio as default, | ||
| parseApiError | ||
| }; |
+7
-7
| { | ||
| "name": "@getlatedev/node", | ||
| "version": "0.1.58", | ||
| "description": "The official Node.js library for the Late API", | ||
| "version": "0.2.0", | ||
| "description": "The official Node.js library for the Zernio API", | ||
| "main": "dist/index.js", | ||
@@ -40,3 +40,3 @@ "module": "dist/index.mjs", | ||
| "keywords": [ | ||
| "late", | ||
| "zernio", | ||
| "social-media", | ||
@@ -59,11 +59,11 @@ "scheduling", | ||
| ], | ||
| "author": "Late <support@getlate.dev>", | ||
| "author": "Zernio <support@zernio.com>", | ||
| "license": "Apache-2.0", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/getlatedev/late-node.git" | ||
| "url": "git+https://github.com/zernio-dev/zernio-node.git" | ||
| }, | ||
| "homepage": "https://getlate.dev/docs/api", | ||
| "homepage": "https://zernio.com/docs/api", | ||
| "bugs": { | ||
| "url": "https://github.com/getlatedev/late-node/issues" | ||
| "url": "https://github.com/zernio-dev/zernio-node/issues" | ||
| }, | ||
@@ -70,0 +70,0 @@ "engines": { |
+26
-26
| <p align="center"> | ||
| <a href="https://getlate.dev"> | ||
| <img src="https://getlate.dev/images/icon_light.svg" alt="Late" width="60"> | ||
| <a href="https://zernio.com"> | ||
| <img src="https://zernio.com/brand/icon-primary.png" alt="Zernio" width="60"> | ||
| </a> | ||
| </p> | ||
| <h1 align="center">Late Node.js SDK</h1> | ||
| <h1 align="center">Zernio Node.js SDK</h1> | ||
| <p align="center"> | ||
| <a href="https://www.npmjs.com/package/@getlatedev/node"><img src="https://img.shields.io/npm/v/@getlatedev/node.svg" alt="npm version"></a> | ||
| <a href="https://www.npmjs.com/package/@zernio/node"><img src="https://img.shields.io/npm/v/@zernio/node.svg" alt="npm version"></a> | ||
| <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" alt="License"></a> | ||
@@ -18,3 +18,3 @@ </p> | ||
| The official Node.js SDK for the [Late API](https://getlate.dev) — schedule and publish social media posts across Instagram, TikTok, YouTube, LinkedIn, X/Twitter, Facebook, Pinterest, Threads, Bluesky, Reddit, Snapchat, Telegram, WhatsApp, and Google Business Profile with a single integration. | ||
| The official Node.js SDK for the [Zernio API](https://zernio.com) — schedule and publish social media posts across Instagram, TikTok, YouTube, LinkedIn, X/Twitter, Facebook, Pinterest, Threads, Bluesky, Reddit, Snapchat, Telegram, WhatsApp, and Google Business Profile with a single integration. | ||
@@ -24,3 +24,3 @@ ## Installation | ||
| ```bash | ||
| npm install @getlatedev/node | ||
| npm install @zernio/node | ||
| ``` | ||
@@ -31,10 +31,10 @@ | ||
| ```typescript | ||
| import Late from '@getlatedev/node'; | ||
| import Zernio from '@zernio/node'; | ||
| const late = new Late(); // Uses LATE_API_KEY env var | ||
| const zernio = new Zernio(); // Uses ZERNIO_API_KEY env var | ||
| // Publish to multiple platforms with one call | ||
| const { data: post } = await late.posts.createPost({ | ||
| const { data: post } = await zernio.posts.createPost({ | ||
| body: { | ||
| content: 'Hello world from Late!', | ||
| content: 'Hello world from Zernio!', | ||
| platforms: [ | ||
@@ -55,5 +55,5 @@ { platform: 'twitter', accountId: 'acc_xxx' }, | ||
| ```typescript | ||
| const late = new Late({ | ||
| apiKey: 'your-api-key', // Defaults to process.env['LATE_API_KEY'] | ||
| baseURL: 'https://getlate.dev/api', | ||
| const zernio = new Zernio({ | ||
| apiKey: 'your-api-key', // Defaults to process.env['ZERNIO_API_KEY'] | ||
| baseURL: 'https://zernio.com/api', | ||
| timeout: 60000, | ||
@@ -68,3 +68,3 @@ }); | ||
| ```typescript | ||
| const { data: post } = await late.posts.createPost({ | ||
| const { data: post } = await zernio.posts.createPost({ | ||
| body: { | ||
@@ -83,3 +83,3 @@ content: 'This post will go live tomorrow at 10am', | ||
| ```typescript | ||
| const { data: post } = await late.posts.createPost({ | ||
| const { data: post } = await zernio.posts.createPost({ | ||
| body: { | ||
@@ -108,3 +108,3 @@ content: 'Default content', | ||
| // 1. Get presigned upload URL | ||
| const { data: presign } = await late.media.getMediaPresignedUrl({ | ||
| const { data: presign } = await zernio.media.getMediaPresignedUrl({ | ||
| body: { filename: 'video.mp4', contentType: 'video/mp4' }, | ||
@@ -121,3 +121,3 @@ }); | ||
| // 3. Create post with media | ||
| const { data: post } = await late.posts.createPost({ | ||
| const { data: post } = await zernio.posts.createPost({ | ||
| body: { | ||
@@ -138,3 +138,3 @@ content: 'Check out this video!', | ||
| ```typescript | ||
| const { data } = await late.analytics.getAnalytics({ | ||
| const { data } = await zernio.analytics.getAnalytics({ | ||
| query: { postId: 'post_xxx' }, | ||
@@ -151,3 +151,3 @@ }); | ||
| ```typescript | ||
| const { data } = await late.accounts.listAccounts(); | ||
| const { data } = await zernio.accounts.listAccounts(); | ||
@@ -162,6 +162,6 @@ for (const account of data.accounts) { | ||
| ```typescript | ||
| import Late, { LateApiError, RateLimitError, ValidationError } from '@getlatedev/node'; | ||
| import Zernio, { ZernioApiError, RateLimitError, ValidationError } from '@zernio/node'; | ||
| try { | ||
| await late.posts.createPost({ body: { /* ... */ } }); | ||
| await zernio.posts.createPost({ body: { /* ... */ } }); | ||
| } catch (error) { | ||
@@ -172,3 +172,3 @@ if (error instanceof RateLimitError) { | ||
| console.log('Invalid request:', error.fields); | ||
| } else if (error instanceof LateApiError) { | ||
| } else if (error instanceof ZernioApiError) { | ||
| console.log(`Error ${error.statusCode}: ${error.message}`); | ||
@@ -483,9 +483,9 @@ } | ||
| - Node.js 18+ | ||
| - [Late API key](https://getlate.dev) (free tier available) | ||
| - [Zernio API key](https://zernio.com) (free tier available) | ||
| ## Links | ||
| - [Documentation](https://docs.getlate.dev) | ||
| - [Dashboard](https://getlate.dev/dashboard) | ||
| - [Changelog](https://docs.getlate.dev/changelog) | ||
| - [Documentation](https://docs.zernio.com) | ||
| - [Dashboard](https://zernio.com/dashboard) | ||
| - [Changelog](https://docs.zernio.com/changelog) | ||
@@ -492,0 +492,0 @@ ## License |
+20
-16
@@ -188,6 +188,6 @@ import { | ||
| import { LateApiError, parseApiError } from './errors'; | ||
| import { ZernioApiError, parseApiError } from './errors'; | ||
| export interface ClientOptions { | ||
| /** | ||
| * API key for authentication. Defaults to process.env['LATE_API_KEY']. | ||
| * API key for authentication. Defaults to process.env['ZERNIO_API_KEY'] (falls back to LATE_API_KEY). | ||
| */ | ||
@@ -198,3 +198,3 @@ apiKey?: string | undefined; | ||
| * Override the default base URL for the API. | ||
| * @default "https://getlate.dev/api" | ||
| * @default "https://zernio.com/api" | ||
| */ | ||
@@ -215,16 +215,16 @@ baseURL?: string | null | undefined; | ||
| /** | ||
| * API Client for the Late API. | ||
| * API Client for the Zernio API. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import Late from '@getlatedev/node'; | ||
| * import Zernio from '@zernio/node'; | ||
| * | ||
| * const late = new Late({ | ||
| * apiKey: process.env['LATE_API_KEY'], // This is the default and can be omitted | ||
| * const zernio = new Zernio({ | ||
| * apiKey: process.env['ZERNIO_API_KEY'], // This is the default and can be omitted | ||
| * }); | ||
| * | ||
| * async function main() { | ||
| * const post = await late.posts.create({ | ||
| * const post = await zernio.posts.create({ | ||
| * body: { | ||
| * content: 'Hello from the Late SDK!', | ||
| * content: 'Hello from the Zernio SDK!', | ||
| * platforms: [{ platform: 'twitter', accountId: 'acc_123' }], | ||
@@ -240,3 +240,3 @@ * publishNow: true, | ||
| */ | ||
| export class Late { | ||
| export class Zernio { | ||
| private _options: ClientOptions; | ||
@@ -626,3 +626,3 @@ | ||
| /** | ||
| * Create a new Late API client. | ||
| * Create a new Zernio API client. | ||
| * | ||
@@ -632,7 +632,8 @@ * @param options - Configuration options for the client | ||
| constructor(options: ClientOptions = {}) { | ||
| const apiKey = options.apiKey ?? process.env['LATE_API_KEY']; | ||
| // Check ZERNIO_API_KEY first, fall back to LATE_API_KEY for backwards compatibility | ||
| const apiKey = options.apiKey ?? process.env['ZERNIO_API_KEY'] ?? process.env['LATE_API_KEY']; | ||
| if (!apiKey) { | ||
| throw new LateApiError( | ||
| "The LATE_API_KEY environment variable is missing or empty; either provide it, or instantiate the Late client with an apiKey option, like new Late({ apiKey: 'sk_...' }).", | ||
| throw new ZernioApiError( | ||
| "The ZERNIO_API_KEY environment variable is missing or empty; either provide it, or instantiate the Zernio client with an apiKey option, like new Zernio({ apiKey: 'sk_...' }). LATE_API_KEY is also supported for backwards compatibility.", | ||
| 401, | ||
@@ -644,3 +645,3 @@ 'missing_api_key' | ||
| this.apiKey = apiKey; | ||
| this.baseURL = options.baseURL ?? 'https://getlate.dev/api'; | ||
| this.baseURL = options.baseURL ?? 'https://zernio.com/api'; | ||
| this._options = options; | ||
@@ -680,3 +681,6 @@ | ||
| /** @deprecated Use Zernio instead */ | ||
| export const Late = Zernio; | ||
| // Default export for convenient usage | ||
| export default Late; | ||
| export default Zernio; |
+11
-8
| /** | ||
| * Base error class for Late API errors | ||
| * Base error class for Zernio API errors | ||
| */ | ||
| export class LateApiError extends Error { | ||
| export class ZernioApiError extends Error { | ||
| public readonly statusCode: number; | ||
@@ -16,3 +16,3 @@ public readonly code?: string; | ||
| super(message); | ||
| this.name = 'LateApiError'; | ||
| this.name = 'ZernioApiError'; | ||
| this.statusCode = statusCode; | ||
@@ -24,3 +24,3 @@ this.code = code; | ||
| if (Error.captureStackTrace) { | ||
| Error.captureStackTrace(this, LateApiError); | ||
| Error.captureStackTrace(this, ZernioApiError); | ||
| } | ||
@@ -72,6 +72,9 @@ } | ||
| /** @deprecated Use ZernioApiError instead */ | ||
| export const LateApiError = ZernioApiError; | ||
| /** | ||
| * Rate limit error with additional rate limit info | ||
| */ | ||
| export class RateLimitError extends LateApiError { | ||
| export class RateLimitError extends ZernioApiError { | ||
| public readonly limit?: number; | ||
@@ -106,3 +109,3 @@ public readonly remaining?: number; | ||
| */ | ||
| export class ValidationError extends LateApiError { | ||
| export class ValidationError extends ZernioApiError { | ||
| public readonly fields?: Record<string, string[]>; | ||
@@ -123,3 +126,3 @@ | ||
| body?: { error?: string; message?: string; code?: string; details?: Record<string, unknown> } | ||
| ): LateApiError { | ||
| ): ZernioApiError { | ||
| const message = body?.error || body?.message || response.statusText || 'Unknown error'; | ||
@@ -148,3 +151,3 @@ const code = body?.code; | ||
| return new LateApiError(message, response.status, code, details); | ||
| return new ZernioApiError(message, response.status, code, details); | ||
| } |
+8
-7
| /** | ||
| * Late - Official Node.js library for the Late API | ||
| * Zernio - Official Node.js library for the Zernio API | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import Late from 'late'; | ||
| * import Zernio from '@zernio/node'; | ||
| * | ||
| * const late = new Late(); | ||
| * const zernio = new Zernio(); | ||
| * | ||
| * const post = await late.posts.create({ | ||
| * const post = await zernio.posts.create({ | ||
| * body: { | ||
@@ -22,7 +22,8 @@ * content: 'Hello world!', | ||
| // Main client export | ||
| export { Late, Late as default, type ClientOptions } from './client'; | ||
| // Main client export (Zernio is primary, Late is kept for backwards compatibility) | ||
| export { Zernio, Zernio as default, Late, type ClientOptions } from './client'; | ||
| // Error exports | ||
| // Error exports (ZernioApiError is primary, LateApiError is kept for backwards compatibility) | ||
| export { | ||
| ZernioApiError, | ||
| LateApiError, | ||
@@ -29,0 +30,0 @@ RateLimitError, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1032368
0.15%23282
0.09%76
4.11%