Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "canonry",
"private": true,
"version": "1.28.2",
"version": "1.29.0",
"type": "module",
"packageManager": "pnpm@10.28.2",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions packages/api-routes/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export async function apiRoutes(app: FastifyInstance, opts: ApiRoutesOptions) {
} satisfies GoogleRoutesOptions)
await api.register(wordpressRoutes, {
wordpressConnectionStore: opts.wordpressConnectionStore,
routePrefix: opts.routePrefix ?? '/api/v1',
} satisfies WordpressRoutesOptions)
await api.register(cdpRoutes, {
getCdpStatus: opts.getCdpStatus,
Expand Down
114 changes: 114 additions & 0 deletions packages/api-routes/src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,45 @@ const routeCatalog: OpenApiOperation[] = [
404: { description: 'Project, connection, or page not found.' },
},
},
{
method: 'post',
path: '/api/v1/projects/{name}/wordpress/pages/meta/bulk',
summary: 'Bulk update SEO meta for multiple pages',
tags: ['wordpress'],
parameters: [nameParameter],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
type: 'object',
required: ['entries'],
properties: {
entries: {
type: 'array',
items: {
type: 'object',
required: ['slug'],
properties: {
slug: stringSchema,
title: stringSchema,
description: stringSchema,
noindex: booleanSchema,
},
},
},
env: { type: 'string', enum: ['live', 'staging'] },
},
},
},
},
},
responses: {
200: { description: 'Bulk SEO meta update results returned.' },
400: { description: 'Invalid entries or environment.' },
404: { description: 'Project or connection not found.' },
},
},
{
method: 'get',
path: '/api/v1/projects/{name}/wordpress/schema',
Expand Down Expand Up @@ -1716,6 +1755,48 @@ const routeCatalog: OpenApiOperation[] = [
404: { description: 'Project, connection, or page not found.' },
},
},
{
method: 'post',
path: '/api/v1/projects/{name}/wordpress/schema/deploy',
summary: 'Deploy JSON-LD schema to WordPress pages',
tags: ['wordpress'],
parameters: [nameParameter],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
type: 'object',
required: ['profile'],
properties: {
profile: {
type: 'object',
description: 'Business profile and per-slug schema mapping',
},
env: { type: 'string', enum: ['live', 'staging'] },
},
},
},
},
},
responses: {
200: { description: 'Schema deployment results returned.' },
400: { description: 'Invalid profile or environment.' },
404: { description: 'Project or connection not found.' },
},
},
{
method: 'get',
path: '/api/v1/projects/{name}/wordpress/schema/status',
summary: 'Get JSON-LD schema status for all pages',
tags: ['wordpress'],
parameters: [nameParameter, wordpressEnvQueryParameter],
responses: {
200: { description: 'Schema status per page returned.' },
400: { description: 'Invalid environment.' },
404: { description: 'Project or connection not found.' },
},
},
{
method: 'get',
path: '/api/v1/projects/{name}/wordpress/llms-txt',
Expand Down Expand Up @@ -1803,6 +1884,39 @@ const routeCatalog: OpenApiOperation[] = [
404: { description: 'Project or connection not found.' },
},
},
{
method: 'post',
path: '/api/v1/projects/{name}/wordpress/onboard',
summary: 'Full WordPress onboarding workflow',
tags: ['wordpress'],
parameters: [nameParameter],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
type: 'object',
required: ['url', 'username', 'appPassword'],
properties: {
url: stringSchema,
stagingUrl: stringSchema,
username: stringSchema,
appPassword: stringSchema,
defaultEnv: { type: 'string', enum: ['live', 'staging'] },
profile: objectSchema,
skipSchema: booleanSchema,
skipSubmit: booleanSchema,
},
},
},
},
},
responses: {
200: { description: 'Onboarding result with step-by-step status.' },
400: { description: 'Invalid onboarding request.' },
404: { description: 'Project not found.' },
},
},
// GA4 routes
{
method: 'post',
Expand Down
Loading
Loading