Skip to content

Commit

Permalink
feat: Export CodeSampleSdk type
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Oct 9, 2024
1 parent 9a38341 commit ff55ab9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/lib/code-sample/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export {
type CodeSample,
type CodeSampleDefinitionInput,
CodeSampleDefinitionSchema,
type CodeSampleSdk,
type CodeSampleSyntax,
createCodeSample,
} from './schema.js'
24 changes: 14 additions & 10 deletions src/lib/code-sample/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ export type CodeSampleDefinitionInput = z.input<

export type CodeSampleDefinition = z.output<typeof CodeSampleDefinitionSchema>

const CodeSampleSdkSchema = z.enum([
'javascript',
'python',
'php',
'ruby',
'seam_cli',
'go',
'java',
'csharp',
])

const CodeSampleSyntaxSchema = z.enum([
'javascript',
'json',
Expand All @@ -57,17 +68,10 @@ const CodeSampleSyntaxSchema = z.enum([

export type CodeSampleSyntax = z.infer<typeof CodeSampleSyntaxSchema>

export type CodeSampleSdk = z.infer<typeof CodeSampleSdkSchema>

const CodeSchema = z.record(
z.enum([
'javascript',
'python',
'php',
'ruby',
'seam_cli',
'go',
'java',
'csharp',
]),
CodeSampleSdkSchema,
z.object({
title: z.string().min(1),
request: z.string(),
Expand Down
1 change: 1 addition & 0 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export {
type CodeSampleDefinitionInput,
CodeSampleDefinitionSchema,
type CodeSampleSyntax,
type CodeSampleSdk,
} from './code-sample/index.js'

0 comments on commit ff55ab9

Please sign in to comment.