54 lines
1.1 KiB
TypeScript
54 lines
1.1 KiB
TypeScript
import { nocoApi } from "./common";
|
|
import bun from 'bun'
|
|
|
|
// const res = await nocoApi.meta.bases.list('')
|
|
// console.log('bases list', res);
|
|
|
|
|
|
// AI id
|
|
const baseId = 'pypv3deh9qzol7q'
|
|
const startId = 'prg9dee7ldbemzd'
|
|
// const res = await nocoApi.meta.tables.list(baseId)
|
|
// console.log('tables list', res);
|
|
|
|
const tableId = 'm9rcgc95ev9d1uo'
|
|
|
|
// const tableMeta = await nocoApi.meta.tables.getTableMeta(tableId)
|
|
|
|
// console.log('tableMeta', tableMeta);
|
|
|
|
// bun.write('meta.json', JSON.stringify(tableMeta, null, 2))
|
|
|
|
const newTables = await nocoApi.meta.tables.createTable(startId, {
|
|
title: '测试表3',
|
|
description: '这是一个测试表3',
|
|
columns: [
|
|
{
|
|
title: 'Title',
|
|
uidt: 'SingleLineText',
|
|
description: '标题列',
|
|
},
|
|
{
|
|
title: 'Summary',
|
|
uidt: 'LongText',
|
|
description: '摘要列',
|
|
},
|
|
{
|
|
title: 'Tags',
|
|
uidt: 'MultiSelect',
|
|
description: '标签列',
|
|
},
|
|
{
|
|
title: 'Description',
|
|
uidt: 'LongText',
|
|
description: '描述列',
|
|
},
|
|
{
|
|
title: 'Link',
|
|
uidt: 'URL',
|
|
description: '链接列',
|
|
},
|
|
]
|
|
})
|
|
|
|
console.log('newTables', newTables); |