-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCreateStyleTool.output.schema.ts
More file actions
36 lines (32 loc) · 1.29 KB
/
CreateStyleTool.output.schema.ts
File metadata and controls
36 lines (32 loc) · 1.29 KB
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
// Copyright (c) Mapbox, Inc.
// Licensed under the MIT License.
import { z } from 'zod';
import { BaseStylePropertiesSchema } from '../../schemas/style.js';
// OUTPUT Schema - For API responses (POST response)
// Uses the same comprehensive schema as RetrieveStyleTool to ensure all
// properties returned by the Mapbox API are explicitly defined.
// This avoids issues with additionalProperties: false in strict validators.
export const MapboxStyleOutputSchema = BaseStylePropertiesSchema.extend({
name: z.string().describe('Human-readable name for the style'),
// API-specific properties (only present in responses)
id: z.string().describe('Unique style identifier'),
owner: z.string().describe('Username of the style owner'),
created: z
.string()
.datetime()
.describe('ISO 8601 timestamp when style was created'),
modified: z
.string()
.datetime()
.describe('ISO 8601 timestamp when style was last modified'),
visibility: z
.enum(['public', 'private'])
.describe('Style visibility setting'),
protected: z
.boolean()
.optional()
.describe('Whether style is protected from modifications'),
draft: z.boolean().optional().describe('Whether this is a draft version')
});
// Type exports
export type MapboxStyleOutput = z.infer<typeof MapboxStyleOutputSchema>;