Updating some further types - added 2 ts-ignores which will be removed on v3 branch.

This commit is contained in:
mike12345567 2024-10-18 17:59:26 +01:00
parent b94498e583
commit e7a6e58751
6 changed files with 11 additions and 5 deletions

View File

@ -2074,6 +2074,7 @@ describe.each([
)
tableId = table._id!
// @ts-ignore - until AI implemented
const rowValues: Record<keyof typeof fullSchema, any> = {
[FieldType.STRING]: generator.guid(),
[FieldType.LONGFORM]: generator.paragraph(),

View File

@ -206,7 +206,7 @@ describe.each([
visible: false,
icon: "ic",
},
} as Record<string, FieldSchema>,
} as ViewV2Schema,
}
const createdView = await config.api.viewV2.create(newView)
@ -250,7 +250,7 @@ describe.each([
name: "Category",
type: FieldType.STRING,
},
} as Record<string, FieldSchema>,
} as ViewV2Schema,
}
await config.api.viewV2.create(newView, {
@ -1044,7 +1044,7 @@ describe.each([
visible: false,
icon: "ic",
},
} as Record<string, FieldSchema>,
} as ViewV2Schema,
})
expect(updatedView).toEqual({
@ -1078,7 +1078,7 @@ describe.each([
name: "Category",
type: FieldType.STRING,
},
} as Record<string, FieldSchema>,
} as ViewV2Schema,
},
{
status: 200,

View File

@ -56,6 +56,7 @@ interface AuthTokenResponse {
const isTypeAllowed: Record<FieldType, boolean> = {
[FieldType.STRING]: true,
[FieldType.FORMULA]: true,
[FieldType.AI]: true,
[FieldType.NUMBER]: true,
[FieldType.LONGFORM]: true,
[FieldType.DATETIME]: true,
@ -490,7 +491,8 @@ export class GoogleSheetsIntegration implements DatasourcePlus {
}
if (
!sheet.headerValues.includes(key) &&
column.type !== FieldType.FORMULA
column.type !== FieldType.FORMULA &&
column.type !== FieldType.AI
) {
updatedHeaderValues.push(key)
}

View File

@ -242,6 +242,7 @@ function copyExistingPropsOver(
let shouldKeepSchema = false
switch (existingColumnType) {
case FieldType.FORMULA:
case FieldType.AI:
case FieldType.AUTO:
case FieldType.INTERNAL:
shouldKeepSchema = true

View File

@ -19,6 +19,7 @@ const FieldTypeMap: Record<FieldType, SQLiteType> = {
[FieldType.BOOLEAN]: SQLiteType.NUMERIC,
[FieldType.DATETIME]: SQLiteType.TEXT,
[FieldType.FORMULA]: SQLiteType.TEXT,
[FieldType.AI]: SQLiteType.TEXT,
[FieldType.LONGFORM]: SQLiteType.TEXT,
[FieldType.NUMBER]: SQLiteType.REAL,
[FieldType.STRING]: SQLiteType.TEXT,

View File

@ -605,6 +605,7 @@ export function fullSchemaWithoutLinks({
}): {
[type in Exclude<FieldType, FieldType.LINK>]: FieldSchema & { type: type }
} {
// @ts-ignore - until AI implemented
return {
[FieldType.STRING]: {
name: "string",