listmonk/frontend/src/constants.js

127 lines
4.0 KiB
JavaScript
Raw Normal View History

export const DateFormat = "ddd D MMM YYYY, hh:mm A"
2018-10-25 15:51:47 +02:00
// Data types.
export const ModelUsers = "users"
export const ModelSubscribers = "subscribers"
export const ModelSubscribersByList = "subscribersByList"
export const ModelLists = "lists"
export const ModelMedia = "media"
export const ModelCampaigns = "campaigns"
export const ModelTemplates = "templates"
// HTTP methods.
export const MethodGet = "get"
export const MethodPost = "post"
export const MethodPut = "put"
export const MethodDelete = "delete"
// Data loading states.
export const StatePending = "pending"
export const StateDone = "done"
// Form types.
export const FormCreate = "create"
export const FormEdit = "edit"
// Message types.
export const MsgSuccess = "success"
export const MsgWarning = "warning"
export const MsgError = "error"
export const MsgPosition = "bottomRight"
2018-10-25 15:51:47 +02:00
// Model specific.
export const CampaignStatusColors = {
2019-03-09 08:46:47 +01:00
draft: "",
scheduled: "purple",
running: "blue",
paused: "orange",
finished: "green",
cancelled: "red"
2018-10-25 15:51:47 +02:00
}
2019-03-09 08:46:47 +01:00
export const CampaignStatusDraft = "draft"
2018-10-25 15:51:47 +02:00
export const CampaignStatusScheduled = "scheduled"
2019-03-09 08:46:47 +01:00
export const CampaignStatusRunning = "running"
export const CampaignStatusPaused = "paused"
export const CampaignStatusFinished = "finished"
2018-10-25 15:51:47 +02:00
export const CampaignStatusCancelled = "cancelled"
export const CampaignStatusRegular = "regular"
export const CampaignStatusOptin = "optin"
export const CampaignTypeRegular = "regular"
export const CampaignTypeOptin = "optin"
export const CampaignContentTypeRichtext = "richtext"
export const CampaignContentTypeHTML = "html"
export const CampaignContentTypePlain = "plain"
2018-10-25 15:51:47 +02:00
export const SubscriptionStatusConfirmed = "confirmed"
export const SubscriptionStatusUnConfirmed = "unconfirmed"
export const SubscriptionStatusUnsubscribed = "unsubscribed"
export const ListOptinSingle = "single"
export const ListOptinDouble = "double"
2018-10-25 15:51:47 +02:00
// API routes.
export const Routes = {
2019-03-09 08:46:47 +01:00
GetDashboarcStats: "/api/dashboard/stats",
GetUsers: "/api/users",
2018-10-25 15:51:47 +02:00
2019-03-09 08:46:47 +01:00
// Lists.
GetLists: "/api/lists",
CreateList: "/api/lists",
UpdateList: "/api/lists/:id",
DeleteList: "/api/lists/:id",
2018-10-25 15:51:47 +02:00
2019-03-09 08:46:47 +01:00
// Subscribers.
ViewSubscribers: "/subscribers",
GetSubscribers: "/api/subscribers",
GetSubscriber: "/api/subscribers/:id",
GetSubscribersByList: "/api/subscribers/lists/:listID",
PreviewCampaign: "/api/campaigns/:id/preview",
CreateSubscriber: "/api/subscribers",
UpdateSubscriber: "/api/subscribers/:id",
DeleteSubscriber: "/api/subscribers/:id",
DeleteSubscribers: "/api/subscribers",
SendSubscriberOptinMail: "/api/subscribers/:id/optin",
2019-03-09 08:46:47 +01:00
BlacklistSubscriber: "/api/subscribers/:id/blacklist",
BlacklistSubscribers: "/api/subscribers/blacklist",
AddSubscriberToLists: "/api/subscribers/lists/:id",
AddSubscribersToLists: "/api/subscribers/lists",
DeleteSubscribersByQuery: "/api/subscribers/query/delete",
BlacklistSubscribersByQuery: "/api/subscribers/query/blacklist",
AddSubscribersToListsByQuery: "/api/subscribers/query/lists",
2018-10-25 15:51:47 +02:00
2019-03-09 08:46:47 +01:00
// Campaigns.
ViewCampaigns: "/campaigns",
ViewCampaign: "/campaigns/:id",
GetCampaignMessengers: "/api/campaigns/messengers",
GetCampaigns: "/api/campaigns",
GetCampaign: "/api/campaigns/:id",
GetRunningCampaignStats: "/api/campaigns/running/stats",
CreateCampaign: "/api/campaigns",
TestCampaign: "/api/campaigns/:id/test",
UpdateCampaign: "/api/campaigns/:id",
UpdateCampaignStatus: "/api/campaigns/:id/status",
DeleteCampaign: "/api/campaigns/:id",
2018-10-25 15:51:47 +02:00
2019-03-09 08:46:47 +01:00
// Media.
GetMedia: "/api/media",
AddMedia: "/api/media",
DeleteMedia: "/api/media/:id",
// Templates.
GetTemplates: "/api/templates",
PreviewTemplate: "/api/templates/:id/preview",
PreviewNewTemplate: "/api/templates/preview",
CreateTemplate: "/api/templates",
UpdateTemplate: "/api/templates/:id",
SetDefaultTemplate: "/api/templates/:id/default",
DeleteTemplate: "/api/templates/:id",
// Import.
UploadRouteImport: "/api/import/subscribers",
GetRouteImportStats: "/api/import/subscribers",
GetRouteImportLogs: "/api/import/subscribers/logs"
2018-10-25 15:51:47 +02:00
}