| 51 | import { GET, POST } from '@/app/api/table/[tableId]/rows/route' |
| 52 | |
| 53 | function buildTable(): TableDefinition { |
| 54 | return { |
| 55 | id: 'tbl_1', |
| 56 | name: 'People', |
| 57 | description: null, |
| 58 | schema: { |
| 59 | columns: [ |
| 60 | { id: 'col_aaa', name: 'Name', type: 'string' }, |
| 61 | { id: 'col_bbb', name: 'Age', type: 'number' }, |
| 62 | ], |
| 63 | }, |
| 64 | metadata: null, |
| 65 | rowCount: 0, |
| 66 | maxRows: 100, |
| 67 | workspaceId: 'workspace-1', |
| 68 | createdBy: 'user-1', |
| 69 | archivedAt: null, |
| 70 | createdAt: new Date('2024-01-01'), |
| 71 | updatedAt: new Date('2024-01-01'), |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | function authAs(authType: 'session' | 'internal_jwt') { |
| 76 | hybridAuthMockFns.mockCheckSessionOrInternalAuth.mockResolvedValue({ |