Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | 93x 1x 1x 1x 2x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 3x 3x 3x 3x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 1x | // Pro API - Core pro operations
// Re-exports types and provides backward-compatible proApi interface
import { request, uploadFile } from "./base";
import { projectsApi } from "./pro/projects";
import { roomsApi } from "./pro/rooms";
import { mediaApi } from "./pro/media";
import { teamApi } from "./pro/team";
import { analyticsApi } from "./pro/analytics";
import { blogImagesApi } from "./blog-images";
import type { Pro } from "./pro/types";
import type {
Blog,
BlogPro,
BlogTag,
ProBlogSuggestion,
SubmitBlogSuggestionInput,
CreateBlogInput,
UpdateBlogInput,
} from "./blogs";
// Re-export all types for backward compatibility
export type {
Pro,
Project,
Room,
Media,
TeamMember,
TeamInvitation,
ContactCheckResult,
} from "./pro/types";
export type {
BlogImage,
PexelsPhoto,
PexelsSearchResult,
UploadBlogImageInput,
AddPexelsImageInput,
AddProjectImageInput,
UpdateBlogImageInput,
} from "./blog-images";
export { crmApi } from "./pro/crm";
export type {
PipelineStage,
LeadSource,
Lead,
LeadActivity,
LeadDocument,
LeadReminder,
CrmSettings,
KanbanData,
CrmDashboard,
ReminderCounts,
CreateLeadInput,
UpdateLeadInput,
AddNoteInput,
ChangeStageInput,
} from "./pro/crm";
export type {
WebsiteTemplate,
ProWebsite,
WebsiteBuildJob,
WebsiteCustomizations,
WebsiteSettingsResponse,
BuildStatusResponse,
PreviewTokenResponse,
UpdateWebsiteInput,
SetCustomDomainResponse,
VerifyDomainResponse,
} from "./pro/website";
export { websiteApi } from "./pro/website";
// Backward-compatible proApi that delegates to split modules
export const proApi = {
// Core pro operations
async getMyRoles() {
return request<{
isAdmin: boolean;
isSuperAdmin: boolean;
platformRoles: string[];
}>(`/api/pro/me/roles`);
},
async getMyPro() {
return request<{
pro: Pro | null;
proId: string | null;
proRole: string | null;
onboardingRequired: boolean;
pendingInvitation?: { token: string };
}>(`/api/pro/me`);
},
async getProfile(proId: string) {
return request<Pro>(`/api/pro/${proId}`);
},
async updateProfile(proId: string, data: Partial<Pro>) {
return request<Pro>(`/api/pro/${proId}`, {
method: "PUT",
body: data,
});
},
// Projects - delegate to projectsApi
listProjects: projectsApi.list,
getProject: projectsApi.get,
createProject: projectsApi.create,
updateProject: projectsApi.update,
deleteProject: projectsApi.delete,
publishProject: projectsApi.publish,
archiveProject: projectsApi.archive,
unarchiveProject: projectsApi.unarchive,
// Rooms - delegate to roomsApi
getRooms: roomsApi.list,
getRoom: roomsApi.get,
createRoom: roomsApi.create,
updateRoom: roomsApi.update,
deleteRoom: roomsApi.delete,
reorderRooms: roomsApi.reorder,
setDefaultRoom: roomsApi.setDefault,
// Media - delegate to mediaApi
getMediaByRoom: mediaApi.listByRoom,
createMedia: mediaApi.create,
createMediaBulk: mediaApi.createBulk,
updateMedia: mediaApi.update,
deleteMedia: mediaApi.delete,
moveMedia: mediaApi.move,
reorderMedia: mediaApi.reorder,
setRoomCover: mediaApi.setRoomCover,
// Team - delegate to teamApi
getTeamMembers: teamApi.getMembers,
addTeamMember: teamApi.addMember,
updateTeamMember: teamApi.updateMember,
removeTeamMember: teamApi.removeMember,
deactivateTeamMember: teamApi.deactivateMember,
reactivateTeamMember: teamApi.reactivateMember,
checkTeamContact: teamApi.checkContact,
inviteTeamMember: teamApi.invite,
getTeamInvitations: teamApi.getInvitations,
resendInvitation: teamApi.resendInvitation,
cancelInvitation: teamApi.cancelInvitation,
// Analytics - delegate to analyticsApi
getProStats: analyticsApi.getProStats,
// Blog Approvals
async getPendingBlogApprovals(proId: string) {
return request<BlogPro[]>(`/api/pro/${proId}/blogs/pending`);
},
async getBlogForApproval(proId: string, blogId: string) {
return request<{ blog: Blog; proAttribution: BlogPro }>(
`/api/pro/${proId}/blogs/${blogId}/preview`,
);
},
async approveBlog(proId: string, blogId: string) {
return request<BlogPro>(
`/api/pro/${proId}/blogs/${blogId}/approve`,
{
method: "POST",
},
);
},
async declineBlog(proId: string, blogId: string, reason: string) {
return request<BlogPro>(
`/api/pro/${proId}/blogs/${blogId}/decline`,
{
method: "POST",
body: { reason },
},
);
},
async requestBlogRewrite(proId: string, blogId: string, feedback: string) {
return request<BlogPro>(
`/api/pro/${proId}/blogs/${blogId}/rewrite`,
{
method: "POST",
body: { feedback },
},
);
},
// Blog Features
async getMyBlogFeatures(proId: string) {
return request<Array<Blog & { attribution: BlogPro }>>(
`/api/pro/${proId}/blogs`,
);
},
// Blog Suggestions
async submitBlogSuggestion(
proId: string,
data: SubmitBlogSuggestionInput,
) {
return request<ProBlogSuggestion>(
`/api/pro/${proId}/blogs/suggestions`,
{
method: "POST",
body: data,
},
);
},
async getMyBlogSuggestions(proId: string) {
return request<ProBlogSuggestion[]>(
`/api/pro/${proId}/blogs/suggestions`,
);
},
// Blog slug availability check
async checkBlogSlug(proId: string, slug: string, excludeId?: string) {
const params = new URLSearchParams({ slug });
if (excludeId) params.set("excludeId", excludeId);
return request<{ available: boolean }>(
`/api/pro/${proId}/blogs/my-blogs/check-slug?${params.toString()}`,
);
},
// Pro Blog Authoring (NEW)
async listMyBlogs(proId: string, filters?: { status?: string }) {
const params = new URLSearchParams();
if (filters?.status) params.set("status", filters.status);
const query = params.toString() ? `?${params.toString()}` : "";
return request<Blog[]>(`/api/pro/${proId}/blogs/my-blogs${query}`);
},
async getMyBlog(proId: string, blogId: string) {
return request<Blog>(`/api/pro/${proId}/blogs/my-blogs/${blogId}`);
},
async createMyBlog(proId: string, data: CreateBlogInput) {
return request<Blog>(`/api/pro/${proId}/blogs/my-blogs`, {
method: "POST",
body: data,
});
},
async updateMyBlog(proId: string, blogId: string, data: UpdateBlogInput) {
return request<Blog>(`/api/pro/${proId}/blogs/my-blogs/${blogId}`, {
method: "PUT",
body: data,
});
},
async listBlogTags(proId: string) {
return request<BlogTag[]>(`/api/pro/${proId}/blogs/blog-tags`);
},
async createBlogTag(proId: string, data: { name: string }) {
return request<BlogTag>(`/api/pro/${proId}/blogs/blog-tags`, {
method: "POST",
body: data,
});
},
async deleteMyBlog(proId: string, blogId: string) {
return request<{ success: boolean }>(
`/api/pro/${proId}/blogs/my-blogs/${blogId}`,
{
method: "DELETE",
},
);
},
async submitMyBlog(proId: string, blogId: string) {
return request<Blog>(
`/api/pro/${proId}/blogs/my-blogs/${blogId}/submit`,
{
method: "POST",
},
);
},
async archiveMyBlog(proId: string, blogId: string) {
return request<Blog>(
`/api/pro/${proId}/blogs/my-blogs/${blogId}/archive`,
{
method: "POST",
},
);
},
async unarchiveMyBlog(proId: string, blogId: string) {
return request<Blog>(
`/api/pro/${proId}/blogs/my-blogs/${blogId}/unarchive`,
{
method: "POST",
},
);
},
async uploadBlogCover(
proId: string,
blogId: string,
file: File,
altText?: string,
) {
return uploadFile(
`/api/pro/${proId}/blogs/my-blogs/${blogId}/upload-cover`,
file,
altText ? { altText } : undefined,
);
},
async submitFeedback(data: {
category: string;
message: string;
pageUrl: string;
browser: string;
screenResolution: string;
location: string;
}) {
return request<{ id: number; message: string }>("/api/pro/feedback", {
method: "POST",
body: data,
});
},
// Blog Images - delegate to blogImagesApi
getBlogImages: blogImagesApi.getBlogImages,
uploadBlogImage: blogImagesApi.uploadBlogImage,
addPexelsImage: blogImagesApi.addPexelsImage,
addProjectImage: blogImagesApi.addProjectImage,
searchPexels: blogImagesApi.searchPexels,
deleteBlogImage: blogImagesApi.deleteImage,
updateBlogImage: blogImagesApi.updateImage,
getBlogImageUrl: blogImagesApi.getImageUrl,
validateAltText: blogImagesApi.validateAltText,
};
|