-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(website): don't expose the server side runtime config in details.…
…json The client side code only needs the client side config, which is already contained in the details.json anyway. Also remove some lint ignores by introducing types for the details.json
- Loading branch information
1 parent
b2fbab3
commit ffee7ee
Showing
7 changed files
with
58 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
import type { CustomDisplay, MetadataType } from '../../types/config.ts'; | ||
export type TableDataEntry = { | ||
label: string; | ||
name: string; | ||
value: string | number | boolean; | ||
header: string; | ||
customDisplay?: CustomDisplay; | ||
type: TableDataEntryType; | ||
}; | ||
import { z } from 'zod'; | ||
|
||
export type TableDataEntryType = { kind: 'metadata'; metadataType: MetadataType } | { kind: 'mutation' }; | ||
import { customDisplay, metadataPossibleTypes } from '../../types/config.ts'; | ||
|
||
export const tableDataEntryTypeSchema = z.discriminatedUnion('kind', [ | ||
z.object({ kind: z.literal('metadata'), metadataType: metadataPossibleTypes }), | ||
z.object({ kind: z.literal('mutation') }), | ||
]); | ||
export type TableDataEntryType = z.infer<typeof tableDataEntryTypeSchema>; | ||
|
||
export const tableDataEntrySchema = z.object({ | ||
label: z.string(), | ||
name: z.string(), | ||
value: z.union([z.string(), z.number(), z.boolean()]), | ||
header: z.string(), | ||
customDisplay: customDisplay.optional(), | ||
type: tableDataEntryTypeSchema, | ||
}); | ||
export type TableDataEntry = z.infer<typeof tableDataEntrySchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters