MCPcopy Index your code
hub / github.com/simstudioai/sim / serializeTableMeta

Function serializeTableMeta

apps/sim/lib/copilot/vfs/serializers.ts:315–339  ·  view source on GitHub ↗
(table: {
  id: string
  name: string
  description?: string | null
  schema: unknown
  rowCount: number
  maxRows: number
  createdAt: Date | string
  updatedAt: Date | string
})

Source from the content-addressed store, hash-verified

313 * Serialize table metadata for VFS tables/{name}/meta.json
314 */
315export function serializeTableMeta(table: {
316 id: string
317 name: string
318 description?: string | null
319 schema: unknown
320 rowCount: number
321 maxRows: number
322 createdAt: Date | string
323 updatedAt: Date | string
324}): string {
325 return JSON.stringify(
326 {
327 id: table.id,
328 name: table.name,
329 description: table.description || undefined,
330 schema: table.schema,
331 rowCount: table.rowCount,
332 maxRows: table.maxRows,
333 createdAt: table.createdAt instanceof Date ? table.createdAt.toISOString() : table.createdAt,
334 updatedAt: table.updatedAt instanceof Date ? table.updatedAt.toISOString() : table.updatedAt,
335 },
336 null,
337 2
338 )
339}
340
341/**
342 * Returns the static model list from PROVIDER_DEFINITIONS for VFS serialization.

Callers 2

materializeTablesMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected