Skip to content

Commit b8e55ad

Browse files
committed
Update API route schemas and router mounts
Standardized API route names and example paths in ApiRoutesSchema, renaming 'actions' to 'automation' and updating descriptions and examples. Added a 'mounts' object to RouterConfigSchema to define default protocol mount points, aligning with the updated route schema.
1 parent 9263a2b commit b8e55ad

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

packages/spec/src/api/discovery.zod.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ export const ApiCapabilitiesSchema = z.object({
1717
* This decouples the frontend from hardcoded URL paths.
1818
*/
1919
export const ApiRoutesSchema = z.object({
20-
/** Base URL for Object CRUD (Standard Data API) */
21-
data: z.string().describe('e.g. /api/v1/data'),
20+
/** Base URL for Object CRUD (Data Protocol) */
21+
data: z.string().describe('e.g. /api/data'),
2222

23-
/** Base URL for Schema Definitions (Metadata API) */
24-
metadata: z.string().describe('e.g. /api/v1/meta'),
23+
/** Base URL for Schema Definitions (Metadata Protocol) */
24+
metadata: z.string().describe('e.g. /api/meta'),
2525

2626
/** Base URL for Authentication */
27-
auth: z.string().describe('e.g. /api/v1/auth'),
27+
auth: z.string().describe('e.g. /api/auth'),
2828

29-
/** Base URL for Server Actions/Flows */
30-
actions: z.string().optional().describe('e.g. /api/v1/p'),
29+
/** Base URL for Automation (Flows/Scripts) */
30+
automation: z.string().optional().describe('e.g. /api/automation'),
3131

3232
/** Base URL for File/Storage operations */
33-
storage: z.string().optional().describe('e.g. /api/v1/storage'),
33+
storage: z.string().optional().describe('e.g. /api/storage'),
3434

3535
/** GraphQL Endpoint (if enabled) */
36-
graphql: z.string().optional().describe('e.g. /api/v1/graphql'),
36+
graphql: z.string().optional().describe('e.g. /graphql'),
3737
});
3838

3939
/**

packages/spec/src/api/router.zod.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ export const RouterConfigSchema = z.object({
8787
*/
8888
basePath: z.string().default('/api').describe('Global API prefix'),
8989

90+
/**
91+
* Standard Protocol Mounts (Relative to basePath)
92+
*/
93+
mounts: z.object({
94+
data: z.string().default('/data').describe('Data Protocol (CRUD)'),
95+
metadata: z.string().default('/meta').describe('Metadata Protocol (Schemas)'),
96+
auth: z.string().default('/auth').describe('Auth Protocol'),
97+
automation: z.string().default('/automation').describe('Automation Protocol'),
98+
storage: z.string().default('/storage').describe('Storage Protocol'),
99+
graphql: z.string().default('/graphql').describe('GraphQL Endpoint'),
100+
}).default({}), // Defaults match standardized spec
101+
90102
/**
91103
* Cross-Origin Resource Sharing
92104
*/

0 commit comments

Comments
 (0)