Object metadata API create one using workspace migration v2 (#13420)
# Introduction In this PR we create basic transpilation methods and utils to handle input to flat, entity to flat, object maps to flat. In order to transpile everything into a common validation that will be implemented in another PR ## FieldMetadataEntity typing Added `never | null` to fields that should never be in order to ease general abstracted method to pass null, as anw it's what is in the database ## Todo - ~~Create a feature flag~~ - Integration test for object creation through metadata api + pg col introspection and snapshoting
This commit is contained in:
+1
-1
@@ -76,7 +76,7 @@ export type FieldMetadataDefaultValue<
|
||||
? FieldMetadataDefaultValueForAnyType | null // Could be improved to be | unknown
|
||||
: T extends keyof FieldMetadataDefaultValueMapping
|
||||
? FieldMetadataDefaultValueForType<T>
|
||||
: never;
|
||||
: never | null;
|
||||
|
||||
type FieldMetadataDefaultValueExtractedTypes = {
|
||||
[K in keyof FieldMetadataDefaultValueMapping]: ExtractValueType<
|
||||
|
||||
+1
-1
@@ -18,4 +18,4 @@ export type FieldMetadataOptions<
|
||||
? null | (FieldMetadataDefaultOption[] | FieldMetadataComplexOption[]) // Could be improved to be | unknown
|
||||
: T extends keyof FieldMetadataOptionsMapping
|
||||
? FieldMetadataOptionsMapping[T]
|
||||
: never;
|
||||
: never | null;
|
||||
|
||||
+1
-1
@@ -60,4 +60,4 @@ export type FieldMetadataSettings<
|
||||
? null | AllFieldMetadataSettings // Could be improved to be | unknown
|
||||
: T extends keyof FieldMetadataSettingsMapping
|
||||
? FieldMetadataSettingsMapping[T] | null
|
||||
: never;
|
||||
: never | null;
|
||||
|
||||
Reference in New Issue
Block a user