sc-postiz-poster/lib/constants.js
2026-06-17 17:40:57 -05:00

36 lines
1.1 KiB
JavaScript

// Compile-time constants for the postiz-poster plugin.
const PLUGIN_NAME = "postiz-poster";
const PLUGIN_VERSION = "0.0.1";
// Postiz public REST API. The surface is identical for self-hosted and cloud;
// only the base URL (plugin config) differs. Endpoint paths below are appended
// to <baseUrl><PATH_BASE>.
const PATH_BASE = "/public/v1";
const ENDPOINTS = {
INTEGRATIONS: "/integrations", // GET -> list connected channels
UPLOAD: "/upload", // POST -> media, returns { id, path }
POSTS: "/posts" // POST -> create / schedule a post
};
// Postiz post "type": publish now, schedule for a date, or save as a draft.
const POST_TYPES = {
NOW: "now",
SCHEDULE: "schedule",
DRAFT: "draft"
};
// Header carrying the Postiz public API key. Some versions expect a bare key
// rather than a Bearer prefix; isolated here so a change is one edit, not many.
// Confirm against docs.postiz.com/public-api before shipping.
const AUTH_HEADER = "Authorization";
module.exports = {
PLUGIN_NAME,
PLUGIN_VERSION,
PATH_BASE,
ENDPOINTS,
POST_TYPES,
AUTH_HEADER
};